4 Replies Latest reply on Oct 13, 2016 10:48 AM by Sreekanth Kasaraneni

    Sets in Calculated fields

    Sanket Deshpande

      Hi all,


      Is it possible to use Sets in an 'if -then ' calculated fields.

      eg. if a=b then 'Set_1'

      else 'Set_2'



      it gives me a boolean error if i create a calculated field like this.

      Kindly help me with the same




        • 1. Re: Sets in Calculated fields
          praveen p

          Hi Sanket,


          you cannot use it the way you are writing it


          Please provide a sample work book which can help us to suggest better



          • 2. Re: Sets in Calculated fields
            Hima vardhan Reddy Pavuluri



            You can use sets in calculations like If Then calculations.


            IF ([>5]) THEN 'Good'

            ELSE 'Bad'



            [>5] is a set with condition having Profit greater than 5. Set will work like this in calculations.10132.PNG

            If that particular value is there in that set it will give True in If statement else it will give false .

            Hope this helps you.

            1 of 1 people found this helpful
            • 3. Re: Sets in Calculated fields
              Sanket Deshpande

              Hi Praveen,


              • I have a column called years which has values like (2015,2016,T Day,T-1 Day)
              • I have a parameter called Trend Selector which has values as Yearly,Quarterly and Monthly, Current and PreviouS Day.
              • Whenever i select Yearly,Quarterly,Monthly i should only see my yearly trend,quarterly,monthly which i handled through dynamic dimension.
              • I need to know how i can handle the same for T and T-1 day since they are a part of the same dimension.



              • 4. Re: Sets in Calculated fields
                Sreekanth Kasaraneni

                Hi Sanket,


                Instead of creating parameters you can show the values directly using filters will this solution work for you?




                you can use sets and create calculation as below


                CASE [Trend selection]

                when  "Yearly" then [Fy year]

                when "T" then if [T_Set] THEN [Year] end

                when "T-1" then if [T-1_Set] then [Year] end



                However when you place this cal in rows or column shelf you see null values which you need to hide



                You cannot show the data "Monthly" and "Quarterly" as you have only year data which is in string format


                please find the attached workbook for your reference