2 Replies Latest reply on Jul 28, 2016 11:23 PM by Sridhar M

    Using Aggregated Column in Calculated Field

    Sridhar M

      Hello Experts,

       

      Would like to get some help if its possible in Tableau. I have three calculated fields out of which first two are working as expected and in the third calculated field I am trying to use the second calculated field which does the aggregation.

      Do we have any work around to use aggregated calculation in a calculated field?

       

      a. Aging_Bucket  => IF [CALENDAR_DATE]<=TODAY() THEN CALENDAR_DATE   --- This gives a list of Calendar Dates

      b. AgingBucketTemp=> countd([Aging_Bucket])                                                      --- This gives the Count Distinct number of Calendar Dates ( ex. 1,2,3,4,5 ,6, 7 etc ..depending on the query) 

       

      c.  This is the critical step

       

      ActualAgingBucket =>   IF [AgingBucketTemp]== 1 THEN "TODAY"

                                         ELSEIF [AgingBucketTemp])>=2 AND [AgingBucketTemp]<=5  THEN  "2-5 Days"

                                         ELSEIF [AgingBucketTemp])>=6 AND  [AgingBucketTemp]<=10 THEN "6-10 Days"

                                         ELSEIF [AgingBucketTemp])>=11  THEN "11+ Days"

                                         END

       

      --- Here I am trying to calculate the Aging Bucket depending on the value I get in the step b. and Tableau is not allowing me use the second calculated field which is an aggregated value.

       

      Could anyone please guide me on how to get through this?

       

      Thanks!!