5 Replies Latest reply on Jun 29, 2018 8:14 AM by DHEERAJ ARORA

    Unable to convert a calculated field to dimension

    DHEERAJ ARORA

      Hi Team,

       

      I am facing a challenge to make a visualization on tableau, it is just a bar graph.

       

      The above one I want to make.

      Below is the data I have attached and the description is also given below:

      On Y axis: Count Distinct PRSN ID WHERE Asset Class='Company Stock'/ Count Distinct PRSN ID

      On X axis: Sum (Balance) WHERE Asset Class='Company Stock' / SUM (Balance)

       

      So I want to show the distribution of Balance across participation rate

       

      I have created 3 calculated field:

      First one is for Y axis:

       

      COUNTD(

      IF [ASSET_CLASS]='Company Stock' THEN ([PRSN_ID]) END

      )

      /

      COUNTD(

      IF [ASSET_CLASS]<>'Loan' THEN ([PRSN_IID]) END

      )

       

      First one is for X axis:

       

      SUM(

      IF [ASSET_CLASS]='Company Stock' THEN (Balance) END

      )

      /

      SUM(

      IF [ASSET_CLASS]<>'Loan' THEN (Balance) END

      )

       

      Third one is :

      IF [Calc_CS_Balance] <= 0 THEN "0%"

      ELSEIF  [Calc_CS_Balance] > 0 AND [Calc_CS_Balance]< 20 THEN "1%-19%"

      ELSEIF [Calc_CS_Balance]>= 20 AND [Calc_CS_Balance] < 50 THEN "20%-49%"    

      ELSEIF [Calc_CS_Balance]>= 50 AND [Calc_CS_Balance] < 75 THEN "50%-74%"    

      ELSEIF [Calc_CS_Balance]>= 75  AND [Calc_CS_Balance]< 100 THEN "75%-99%"

      ELSEIF [Calc_CS_Balance]>= 100 THEN "100%"    

      END

       

      I have created the all but when I put the third one it is not giving all bucket instead it give 1 value.

       

      Please help me to build this...!!

       

      Thanks

         

      PRSN IDAsset ClassPlanBalance
      1Company StockPlan A271
      2EquityPlan A304
      3Mutual FundFinance164
      4Company StockFinance328
      5SharesPlan A389
      6LoanPlan A236
      7Company StockFinance224
      8EquityFinance230
      9Mutual FundPlan A223
      10SharesPlan A353