5 Replies Latest reply on Nov 26, 2013 7:08 AM by Djalal Bougriou

    Unable to change a measure(if statement) to a dimension even though it is a dimension in the first place

    Djalal Bougriou

      Hi everyone,

       

      I contact about a calculated field I want to create. I want to create a calculated field named Income repartition.

      The formula I used is the following

       

      If sum([Gross Income])<5 then '<5€'

      Elseif sum([Gross Income])=5 then '5€'

      Elseif sum([Gross Income])<10 then '5€-10€'

      Elseif sum([Gross Income])=10 then '10€'

      Elseif sum([Gross Income])<20 then '10€-20€'

      Elseif sum([Gross Income]))=20 then '20€'

      Elseif sum([Gross Income]))<30 then '20€-30€'

      Elseif sum([Gross Income]))=30 then '30€'

      Elseif sum([Gross Income]))<40 then '30€-40€'

      Elseif sum([Gross Income]))=40 then '40€'

      Elseif sum([Gross Income]))<50 then '40€-50€'

      Elseif sum([Gross Income]))=50 then '50€'

      Else '>50€'

      End

       

      In the end this is valid, but the field created is considered as a measure in Tableau & I am unable to turn it into a dimension how it should be. When I use the formula by removing the sum(), the field created is considered as a dimension. (But this field is not the one that needs to be created.) The other formula is the following.

       

      If [Gross Income ]<5 then '<5€'

      Elseif [Gross Income ]=5 then '5€'

      Elseif [Gross Income ]<10 then '5€-10€'

      Elseif [Gross Income ]=10 then '10€'

      Elseif [Gross Income ]<20 then '10€-20€'

      Elseif [Gross Income ]=20 then '20€'

      Elseif [Gross Income ]<30 then '20€-30€'

      Elseif [Gross Income ]=30 then '30€'

      Elseif [Gross Income ]<40 then '30€-40€'

      Elseif [Gross Income ]=40 then '40€'

      Elseif [Gross Income ]<50 then '40€-50€'

      Elseif [Gross Income ]=50 then '50€'

      Else '>50€'

      End

       

      My question is then, is this a known issue that when using this type of formula it is considered as a measure, even though it should be considered as dimension? If so, would you what to do to have it as a measure?

       

      I have enclosed a packaged workbook, where both formulas are present, they are named "Income repartiton" & the other one is named sum Gross Income Repartition.


      I hope my question is clear enough & I provided enough information to answer.


      Best regards,

      Djalal