2 Replies Latest reply: Feb 28, 2013 6:46 PM by Leilani Lau RSS

    Sort pie chart legend on calculated dimension

    Leilani Lau

      I have a calculated dimension to put records into one of four groups:

      =if(PolYears >=1 and PolYears <=4, 'Insured Less Than 5 Years',

      if(PolYears >=5 and PolYears <=9, 'Insured 5-9 Years',

      if(PolYears >=10 and PolYears <=14, 'Insured 10-15 Years','Insured 15+ Years')))

       

      Is there a way to sort the legend based on the value of the calculated dimension?

      Insured Less than 5 Years

      Insured 5-9 Years

      Insured 10-15 Years

      Insured >15 Years

       

      Thanks!

      Leilani

        • Re: Sort pie chart legend on calculated dimension
          Celambarasan Adhimulam

          Check the sort by expression option in the sort tab

          Expression as

          =if(PolYears >=1 and PolYears <=4, 1,

          if(PolYears >=5 and PolYears <=9, 2,

          if(PolYears >=10 and PolYears <=14, 3,4)))

           

          Edit:

          Another way is using Dual

          Change your calculated dimension to

          =if(PolYears >=1 and PolYears <=4, Dual('Insured Less Than 5 Years', 1),

          if(PolYears >=5 and PolYears <=9, Dual('Insured 5-9 Years', 2),

          if(PolYears >=10 and PolYears <=14, Dual('Insured 10-15 Years', 3),Dual('Insured 15+ Years', 4))))

           

          Sort by number as Ascending.

           

          Hope it helps

          Celambarasan