12 Replies Latest reply on Mar 21, 2014 9:49 AM by Tom W

    Aggregation with 'deep' data structure

    Tom W

      I've provided a packaged workbook using a 'deep' data structure.

      That is, I have a Metric field and a Metric Value field, rather than having 1 column per metric.

       

      I've setup a couple of Calculated Fields i.e.
      PercentageDiscount = If Metric = 'PercentageDiscount' then MetricValue End

      PercentageInventory = IF Metric = 'PercentageInventory' THEN MetricValue End

       

      These work fine.

       

      Now what I need to do, is perform a calculation on those two fields at the lowest level and aggregate it up. Effectively I need to do PercentageDiscount * PercentageInventory on a line by line basis then aggregate it.

      The problem is, this doesn't even seem to work at the lowest level, as per the calculated field 'DiscxInv', it's just showing blank.

       

      I definitely have the option to produce a dataset which is one metric per column, but i'd like to avoid it as it means I need to do more work in views, tables and proc's in the DB where as I'd rather push the responsibility onto the users in Tableau.

       

      Thanks,


      Tom