6 Replies Latest reply on Apr 11, 2017 11:12 AM by Steve Field

    Using a calculated field based on aggregates as a dimension

    Steve Field

      Hi Everyone,

      I'm really stuck and I am starting to think maybe this isn't possible but I'll give it a shot here in case there's a work around...

       

      In my workbook I have a calculated a measure called Average Price which is SUM(Sales)/SUM(Quantity).  I have another Calculation called Price groupings that is If Average Price > 50 then "TOP" Elseif Average Price < 20 then "Bottom" else "Middle" END.

       

      Ideally I'd like to use my Price Groupings as a dimension so that I can summarize Zip codes by Price grouping either by creating a hierarchy or even by subtotals, the problem is that because Average Price is calculated using aggregates (SUM(SALES)/SUM(QUANTITY)  I can't convert it to a dimension... any thoughts on a possible work around.... I've attached a Tableau 10.2 sample packaged workbook using the super store sample DB so you can better see what I'm attempting to do.