IF statement in calculated SharePoint 2010column

Can someone look at this syntax for a calculated SharePoint column. I am getting a syntax error - SharePoint 2010.
=IF([RESP]=””,”Black”,IF([RESP]=”C1″,”Red”,IF([RESP]=”G1″,”Gold”,IF([RESP]=”A6″,”Green”,IF([RESP]=”E7″,”DarkBlue”,IF([RESP]=”A5″,”DarkCyan”,IF([RESP]=”L9″,”DarkRed”,IF([RESP]=”L6″,”Gray”,””))))))))
Thanks
Chad

AnotherSharePointRookie,
As per your description
I have created a list in my environment
Crate 2 column as per your formula
use below formula
=IF(RESP="","Black",IF(RESP="C1","Red",IF(RESP="G1","Gold",IF(RESP="A6","Green",IF(RESP="E7","DarkBlue",IF(RESP="A5","DarkCyan",IF(RESP="L9","DarkRed",IF(RESP="L6","Gray",""))))))))
It worked as per expectation
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

Similar Messages

  • Statements in calculation fields

    Can you use sql statements in calculated fields, for instance can you use a statement like IF(GL_SEGMENT-04='401000'TO'409999'THEN SUM(GL_BALANCE_PERIOD_BAL_DB-GL_BALANCE_PERIOD_BAL_CR)
    I would think that you could use statements within calculated fields but I am having no luck.
    Thanks in advance

    You are so close, I guess. An alternative syntax you may try:
    SUM(CASE WHEN SEGMENT3 BETWEEN '401010' AND '405999' THEN PERIOD_NET_DR-PERIOD_NET_CR ELSE 0 END)
    You may get error message for not using table prefix. In that case, use the table prefix with each field. As you have seen, Discoverer takes care of the prefix when it first executes the formula. Regarding 0 balance, make sure that the sum is not zero for that range. You may also try with a bigger range. Good luck!

  • If statement in calculated batch characteristic (dependencies)

    I have a little problem with calculating a certain batch characteristic.
    The situation is the following:
    I have batch char A, batch char B and batch char C. Batch char C is the result of the sommation of char A and B. The problem I have now is that batch char C only should be calculated when batch char A and B are different from 0.
    I have a custom build interface that imports QM data to the batch chars. Default, all my batch chars are set to 0 so if I just say $self.charC = $self.charA + $self.charB, I always get a value.
    Is it possible to some sort of IF statement to check if the value is different from 0?

    Dear,
    You need to try with variant table
    take all the combination and enter in a variant table and see the result...it works
    example
    A     B      C
    0      0      space
    0      1      sapce
    1      1      space
    I hope you got it

  • Getting an error while using if statement in calculated column.can anyone please help me with this issue

    I am trying to learn HANA on my own.i have product id,product name,delivery date and Grossamount in my calculated view.i am trying to create calculated column where i need Grossamount in two columns based on delivery date.I have 2012 and 2013 as values for my delivery date.so i have created two column as grossamount_2012 and grossamount_2013.if i have delivery date as 4thdec,2012 i want the grossamount value to be in coloumn grossamount_2012 and the grossamount_2013 should be blank.i have written an expression like this
    if("Deliverydate" <= longdate(2012-12-04),"Grossamount","0")
    and it looks like this is wrong.i am getting the text Grossamount rather than values for that field in my output.so can anyone help me please?

    Hi chandra
    i am trying to get the same result by using sql script and CE functions.i have written the following code
    select A."PRODUCTID",
           E."TEXT" as "PRODUCTNAME",
           C."COUNTRY",
           D."DELIVERYDATE",
           Sum(D."GROSSAMOUNT") as "GROSSAMOUNT"
           from "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Products" as A     
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.BusinessPartner" as B
           on A."SUPPLIERID" = B."PARTNERID"      
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.MasterData.Addresses" as C
           on B."ADDRESSID" = C."ADDRESSID"
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.Purchase.Item" as D
           on A."PRODUCTID" = D."PRODUCTID"
           inner join "SAP_HANA_DEMO"."sap.hana.democontent.epm.data::EPM.Util.Texts" as E
           on A."NAMEID" = E."TEXTID"
           GROUP BY A."PRODUCTID",E."TEXT",C."COUNTRY",D."DELIVERYDATE"; 
    this is working fine but i want to split the grossamount based on current year and last year.Any idea how to do this
    In calculation view using script can we use if and case statements?

  • If statement formula in Sharepoint 2013 returns and error

    Hello
    I am trying to create an IF statement  and keep getting the following
    Technical Details
    Learn more about the syntax for formulas.
    Troubleshoot issues with Microsoft SharePoint Foundation.
    Correlation ID: 6f86ad9c-2538-00bf-c686-c2b81c8e95eb
    Date and Time: 8/11/2014 6:00:02 PM
    I was told to create it in Excel then copy/paste into SP.  Here is the formula and it works perfectly in Excel:
    =IF(A11="H8K77AE - Face to face training ($750 USD/Day)","SAP",IF(A11="H8K78AE - Virtual Instructor Led training ($500 USD/Day)","SAP2",IF(A11="H8K79AE - Break/fix demos on lab equip WITH Instructor
    ($400 USD/Day)","SAP3",IF(A11="H8K80AE - Break/fix demos on lab equip WITHOUT Instructor ($200 USD/Day)","SAP4",IF(A11="H8K77A1 - Face to face training ($750 USD/Day)","Fusion",IF(A11="H8K78A1 - Virtual
    Instructor Led training ($500 USD/Day)","Fusion2",IF(A11="H8K79A1 - Break/fix demos on lab equip WITH Instructor ($400 USD/Day)","Fusion3",IF(A11="H8K80A1 - Break/fix demos on lab equip WITHOUT Instructor ($200 USD/Day)","Fusion4",""))))))))
    The only difference is I change the cell references of "A11", to the field name in SharePoint "[SKU#]".  when I hit OK I get the error above.  Does the field name not need to have the brackets around it or is it something
    different? 
    I am really hoping someone can help here as this should be rather simple and not sure why I don't get a result based on what is selected in the [SKU #] field
    Thank you for your assistance.
    Amathyst

    Try using the actual column name.

  • CASE statement in Calculated column

    Hi Frzz,
    I have below requirement in Calculated column with CASE statement. Could some one help me how to achieve this with case statement.
    String  =   0Hello
                    01Hello
                    012Hello
                    0123Hello
    If  1st Character of the string is '0' then  -  0Hello
        1st 2 characters of the String is '01'  -   22Hello
        1st 3 characters of the String is '01'  -   333Hello
        1st 4 characters of the String is '01'  -  4444Hello
    Thank you.
    Best Regards,
    Krishna.

    Hi Krishna ,
    Using IF and MATCH to do that: ( I took one of the conditions you specified )
    IF(match("STRING1",'??0??'),'333Hello',"STRING1")
    Output:
    Regards,
    Krishna Tangudu

  • Workflow stuck in starting state after applying SharePoint 2010 CU December 2012

    I have custom visual studio workflow which are associated with Custom content type. workflow gets triggered automatically when a file is uploaded to SharePoint. Everything was working fine till when i apply the following CU
    http://blogs.msdn.com/b/joerg_sinemus/archive/2012/12/27/sharepoint-2010-and-december-2012-cu.aspx
    After applying this my workflow get stuck in "Starting" state.
    No error were logged in 14 hive logs.
    Thanks in Advance!

    It took me a while but I came up with a work around.  There is a PowerShell script below that can be used to trigger the workflow.  Hopefully this will hold all of us over until the official fix arrives.
    First remove the auto start on change or new from the affected workflow
    Edit the script below to match your environment
    Add the script to Windows task scheduler with the PowerShell.exe in the command line
    This assumes PowerShell.exe is in the path
    Then add the full path and script name in the add arguements text box
    Script:
    #The purpose of this script is to start the SPD workflow with the windows task scheduler for a trigger
    #This should avoid the check in-out issue caused by the December 2012 SP CU patch
    #This needs to be run on an account with membership in the farm administration group for SharePoint and Shell in SQL
    #You can use a find and replace to replace the server and other names with your actual names
    #There are no status messages being used since this will be a scheduled task in the Windows task scheduler
    #Add SharePoint modules and create variable space
    add-pssnapin microsoft.sharepoint.powershell
    start-spassignment -global
    #Open the web site, list and the workflow
    $site=get-spsite %site url%"
    $web=get-spweb %Web url%
    #Open the %affected% library or list and workflow association
    $%affected%=$web.getlist("%affected%")
    $manager=$site.workflowmanager
    $culture=[system.globalization.cultureinfo]::currentculture
    $wfname="%affected workflow name"
    $association=$%affected%.workflowassociations.getassociationbyname($wfname,$culture)
    $data=$association.associationdata
    $wfrunoption=[microsoft.sharepoint.workflow.spworkflowrunoptions]::synchronous
    #Start workflow
    foreach ($item in $%affected%.items) {
    $site.workflowmanager.startworkflow($item,$association,$data,$wfrunoption)
    stop-spassignment -global

  • IF statement in Calculated Field for Share point, doesnt calculate sum in my Excel Pivot table.

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

    Hi Everyone
    I used this in SP calculated column field.
    =IF([Shift Sched]="1pm to 10pm","0",IF([Shift Sched]="2pm to 11pm","1",IF([Shift Sched]="3pm to 12am","2",IF([Shift Sched]="4pm to 1am","3",IF([Shift Sched]="5pm to 2am","4",IF([Shift
    Sched]="6pm to 3am","5",IF([Shift Sched]="7pm to 4am","6",IF([Shift Sched]="8pm to 5am","7",IF([Shift Sched]="9pm to 6am","8",IF([Shift Sched]="10pm to 7am","8",IF([Shift
    Sched]="11pm to 8am","7",IF([Shift Sched]="12pm to 9am","6",IF([Shift Sched]="1am to 10am","5",IF([Shift Sched]="2am to 11am","4",IF([Shift Sched]="3am to 12pm","3",IF([Shift
    Sched]="4am to 1pm","2",IF([Shift Sched]="5am to 2pm","1",IF([Shift Sched]="6am to 3pm","0",IF([Shift Sched]="7am to 4pm","0",IF([Shift Sched]="8am to 5pm","0",IF([Shift
    Sched]="9am to 6pm","0",IF([Shift Sched]="10am to 7pm","0",IF([Shift Sched]="11am to 8pm","0",IF([Shift Sched]="12pm to 9pm","0"))))))))))))))))))))))))    
    it was able to work fine however my issue is when i extract the information to excel and use a pivot table the table is not able to calulate the sum of the value for this field. Can you please help me with this. this is for an Attendance traker for Night
    Differential pay for employees. they create a daily log of their shift schedule and if i summarize this in pivot the value in the calculated field for this is not getting the sum.
    Thanks,
    Norman

  • If statement for calculated column

    Hi, I need to know if its possible to do the following in a calculated column
    if column1 value => 1
    display the name of column1 + the value of column 1
    is this possible?

    Hi hein,
    You can return your calculated column value as "Number" type, set the "blank space" in your formula, see the formula as follow,
    =IF([A4 Printing Paper Box]>0,"[A4 Printing Paper Box]"&[A4 Printing Paper Box]," ")
    http://msdn.microsoft.com/en-us/library/bb862071.aspx
    Thanks
    Daniel Yang
    TechNet Community Support

  • How can i use "View State" Concept in sharepoint sandbox soltuions??

    I need to do video player in sharepoint sandbox solutions..I used following code in form solution the same code i need to use sandbox solution..In this code i am using "viewstate" asp control..i don't know how to use in sandbox solutions..how to use??<html><head></head><body> <object classid="clsid:566DB6E-A56D-10pf-96B8-4488888000" width="425" height="344"><param name="movie" value="player.swf" />         <param name="flashvars" value="file=<%= ServerVideo %>"&"Preview=<%= ServerUrl %>" &autoplay="false" &showPlaylist="false" />
             <param name="allowFullScreen" value="true" />
             <param name="wmode" value="transparent" />
             <param name="autoplay" value="false" />
             <param name="allowscriptaccess" value="always" />
             <embed src="hdplayer.swf" & 
             flashvars="file=<%=ServerVideo%>"& Preview="<%= ServerUrl %>"&showPlaylist="false" 
             style="width:425px;height:344px" allowFullScreen="true" allowScriptAccess="always" 
             type="application/x-shockwave-flash" wmode="transparent"></embed></object></body></html>

    Hello,
    For those still looking, you should ask on the
    SharePoint forums.
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?&lt;=\G.{2})'|%{if($_){[char][int]&quot;0x$_&quot;}})

  • SQL Statement for Calculating Total Staff Absence

    Hi Guys, I hope I'm posting this in the right location.
    I have a database with the following information in a table.
    StaffID, StartDate, EndDate,
    I currently have the following statement to calculate total days between dates as follows;
     SELECT StaffID, DATEDIFF(day, StartDate, EndDate) AS DaysAbsence, StartDate, EndDate, ABID FROM Table;
    I now wont to group all the absences by StaffID and calculate the total number of days. 
    How would I go about doing this I have tried the following which didn't work.
    SELECT StaffID, SUM(DATEDIFF(day, StartDate, EndDate)) AS DaysAbsence, StartDate, EndDate, ABID FROM StaffAbsence;
    and generated the following error:
    Msg 8120, Level 16, State 1, Line 1
    Column 'StaffAbsence.StaffID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
    Any suggestion on how to go about fixing this?

    SELECT StaffID
    , SUM(DATEDIFF(day, StartDate, EndDate)) AS DaysAbsence FROM StaffAbsence
    Group by StaffID;
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • SQL statement for calculating performance targets

    Hi
    I have taken of the admin of a database which stores project goals and scores. I have to develop a way to calculate how well all projects meet these scores. The table concerned is called goal and looks like this:
    goal
    goal_name
    project_code
    current_value
    good_value
    bad_value
    This can be for many different goals, for example if a project wants to get up a goal of having no more than 5 bugs in the project. I can also set a bad value, say 20, so if any projects have 20 or more bugs, triggers or alerts can be sent So I can enter into this table. The reason for putting 5 for good not 20 is because these scores are to be realistic.
    project_code = foo
    goal_name = software bugs
    good_value = 5
    bad_value = 20
    However, some goals may have the values switched and be in a much higher range, or may even be a percentage. For example one for number of sales could be
    project_code = foo
    goal_name = software sales
    good_value = 200
    bad_value = 50
    or project delay
    project_code = foo
    goal_name = sproject delay
    good_value = 0%
    bad_value = 50%
    i am trying to develop a SQL statement so I can get a % score of how well a goal is performing, so I can see
    What is the goal % for all foo goals
    Or what is the goal % for goal 'software sales'
    And also more importantly, how well are the goals doing globally.
    The requirement for doing this is using a single SQL statement, well, one SQL statement for the requirements I listed above, so for example the semantics are
    SELECT average(goal perforance) WHERE .... project = foo .... or goal = software sales... etc
    I am having trouble doing this, I have been banging my head against mydesk all day. the biggest thing is thowing me off is that the good value can be higher or lower than the bad value, and I am having trouble visualizing how to but this conditional statement in SQL
    One more thing, the percentage returned should never be more than 0% or 100%.
    If anyone has any ideas or pointers, please help me out,
    Thanks for your time,
    Message was edited by:
    user473327

    I am having trouble doing this, I have been banging
    my head against mydesk all day. the biggest thing is
    thowing me off is that the good value can be higher
    or lower than the bad value, and I am having trouble
    visualizing how to but this conditional statement in
    SQLI haven't looked at your requirements in detail cos I don't have time for such cumbersome tasks. However, you could have two UNION'd select statements, one which caters for the good > bad and one which caters for the good < bad. Also and alternative would be the use of DECODE or CASE statements in your select which are good for switching things around based on conditions.
    ;)

  • Wrong calculated profit/loss in f.01 financial statement

    i have created new finanical statment version in ob58.
    and i am using that in f.01 financial statement,
    but calculated profit coming wrong
    why it is coming wrong,
    & how it is calculating.

    Hi Thiru
    In OB58, double-click on your newly created Financial Statement Version and then click on Fin. Statement Items
    This includes all your accounts that are linked to your FSV. You can change the order or add / remove the accounts from this setting and then save your FSV.
    We surely can't say WHY is your profit wrong, but this might suggest you HOW it calculates and can be corrected.
    Let me know if it helps.
    Regards
    Zubin

  • Workflow email reminders on calculated date column - Paused

    I am having an issue in trying to setup a SP designer workflow to be able to send a notification if an approval is not met by a certain date. I was hoping someone could point out where I am going wrong with the
    workflow details below?
    The workflow is based off an infopath form. The form when submitted sends an email to the appropriate person that an action is required (which works fine). I
    have created a calculated column (Reminder-2A) which is [Created]+20. So the approver has 20 days to approve the form. The workflow is required to send a notification to the user if the form has not been approved.
    I have tried to use the "Start on item change" workflow context & paused the workflow until the ReminderDate is greater than or equal today. There are 2 steps for this approval so I have 2 approval steps based off the FormStatus when the approval
    takes place.
    So the issue stems from the first step not getting released from its pause state. I was hoping that once the form is approved the FormStatus field would force the workflow to complete that step (unpause) and move to the next step but how I have it currently,
    it does not work that way. Can someone point me in the right direction as how I go about achieving this?
    I have attached a snippet of the 2 stage approval and the workflow state on the SharePoint site
    Many thanks

    Hi Luca,
    I think you can use event handler associated with item for item changed. Every time an item has been edited, check whether a workflow instance is still running. If so, cancel the running workflow. This link would help you. http://chrissyblanco.blogspot.com/2007/08/cancelling-running-workflow.html
    If you don't want to go for coding, you can try below approach, SP designer workflows have this behavior that they do not stop when the item is updated.
    Create 2 lists (parent and child) and a workflow on each (wf1 and wf2) respectively. When your condition meets in the workflow(wf1) of parent list, create an item in child list on which the wf2 workflow starts and pauses till the specified date. Once the
    pause is completed, you can send the mail from workflow 1 or 2 and then delete the item in child list.
    Modify your Parent list workflow to handle the below scenario. If you ever update the item in parent list, delete the corresponding item in child list that was paused/waiting and create a fresh one.
    You need to store the fields Parent list Item ID, version(optional).
    Parent list is your actual list. Child list is a staging one which you never expose to anyone.
    Thanks Sandy

  • IF Condition in Calculated Key Figure .

    Hi,
       can anyone can tell the syntax for using "If Statement in Calculated key figure ".

    Hi,
    If amt1 ne amt2.
      select amt1.
    endif.
    Try the following for above condition :
    Create a formula varible.
    1) select 'amt1'.
    2) Go to boolean, select 'is not equal to'.
    3) select 'amt2'.
    4) select '*'.
    5) select 'amt1'.
    its looks like
    'amt1'<>'amt2'*'amt1'
    hope this helps..
    regards,
    raju

Maybe you are looking for

  • Column link in interactive report to run procedure and refresh

    I have an interactive report which displays a report based on a table. This is a summary table populated overnight from some complex spatial analysis, which takes a few hours to run. I have a requirement to allow the user to refresh one row in this t

  • Border styles not applied to buttons; buttons rendered incorrectly

    Hi, I'm fiddling about with the border styles in Designer. Though I can change the border style and color of a button, set its background-color and even apply round corners, none of them are rendered in the resulting pdf-file. This is how a fancy but

  • How to make ALEAUD trigger XI scenario

    I've been reading a lot of messages on this but not found good answers to this requirements. I would like to trigger a XI non BPM scenario when I receive an ALEAUD back from R/3 on FI message type. The idea behind is to read certain fields from ALEAU

  • Java Math

    I have an assignment due tomorrow to create a stock market screen. It is suppose to display the stock symbol, purchase price, number of shares, the current stock price, and then calculate the following worth bought gain/loss. I do not have a clue wer

  • Organising iTunes on D: drive

    Hi, I moved iTunes to the D: partition on my computer last year using excellent edvice from this discussion. I'm currently "tidying up" my computer and have realised that while all of my music is now on D: and lots of other iTunes bits and pieces too