6 Replies Latest reply: Dec 3, 2014 8:22 AM by Joseph Simmons RSS

    Label Names

      Hi All


      I written some code to change a field name depending on the criteria selected.


      There are two fields if only one is selected the code works fine, however if both are selected one field name is left blank.


      This is my code


      =if("Scenario_Desc"='FULL YEAR BUDGET','Annual Budget',

          if("Scenario_Desc"='CUMULATIVE BUDGETS','Budget To Date',''))


      =if("Scenario_Desc"='YEAR END FORECAST','Year End Forecast',

          if("Scenario_Desc"='CUMULATIVE ACTUALS','Actual To Date',''))


      I want what was the Budget Column to say Annual Budget or Budget To Date depending on what is selected and similarly for what was the actual column.


      I've attached a picture with lines showing what I want where.


      Hope this makes sense.


      Thanks for your continued help.

        • Re: Label Names
          Liron Baram

          hi if you want to be able to change the budget column name and actual

          each one by a different selection ,

          then you need to create to separate fields

          because as of right now if you only select "CUMULATIVE ACTUALS"


          then the budget expression returns null because both if statements aren't true


          the other option is to create one field with the values : Actual , Forecast

          and then your expressions will look lik this

          =if("Scenario_Desc"='Forecast','Annual Budget',

              if("Scenario_Desc"='Actual','Budget To Date',''))


          =if("Scenario_Desc"='Forecast','Year End Forecast',

              if("Scenario_Desc"='Actual','Actual To Date',''))

          • Re: Label Names
            Joseph Simmons

            Hi Andrew,


            Another option you have is to use concat and index to deal with multiple selections.


            =If(Index( Concat([Scenario_Desc]),'FULL YEAR BUDGET')>0, 'Annual Budget',

                if(Index( Concat([Scenario_Desc]),'CUMULATIVE BUDGETS')>0,'Budget To Date',''))


            something like that


            hope that helps


              • Re: Label Names

                Hi Joe & Liron


                Thanks for the replys.


                Both options work if I select one Scenario Description, however I get blanks if two are selected.


                In the example I attached the user must select


                One of 'FULL YEAR BUDGET' or ,'CUMULATIVE BUDGETS'


                and one of 'YEAR END FORECAST' or 'CUMULATIVE ACTUALS'


                So both columns should always have a description.



                  • Re: Label Names
                    Joseph Simmons

                    Hi Andrew,

                    the above works for multiple selections, looks like 'Business Stream' has no budget and that is what is causing the problem.


                    Just need to modify slightly to ignore that selection


                    =If(Index( Concat({<[Business Stream]=>} [Scenario_Desc]),'FULL YEAR BUDGET')>0, 'Annual Budget',

                        if(Index( Concat({<[Business Stream]=>} [Scenario_Desc]),'CUMULATIVE BUDGETS')>0,'Budget To Date',''))

                    • Re: Label Names
                      Aaron Morgan

                      Hi Andrew,


                      Try using:


                      =If(Index(GetFieldSelections(Scenario_Desc), 'FULL YEAR BUDGET'), 'Full Year Budget',

                      If(Index(GetFieldSelections(Scenario_Desc), 'CUMULATIVE BUDGETS'), 'Budget To Date',))


                      For the Budgets one, and the same but with the two field values for Actual, and it should work.