7 Replies Latest reply on Jan 17, 2018 1:01 PM by Nick Zincone

    Performing aggregation against the view

    Nick Zincone

      I recently posted this question where I was interested in combining rows within my sheet and performing a calculation against a sub-group.  The response was correct which looked something like this:


      { FIXED [Group]:SUM(IF [Subgroup] = "Sub-group1" THEN [Event Cnt] END)}


      { FIXED [Group]:SUM(IF [Subgroup] = "Sub-group2" THEN [Event Cnt] END)}


      This works great against the source table, however, I want to implement filters within my sheet and would like the calculation to respect what is being viewed only, not what is within my data source table.  I initially thought using the INCLUDE instead of FIXED may work, but that seem to do something unexpected.  I'm quite new to Tableau and realizing very quickly how challenging, yet powerful this product is.


      For example, I have the following workbook and sheet.  As you can see, the %value correctly displays the proper ratio.  That is [total events - for sub-group2] / [total events - for sub-group1] within a specific group.



      However, if I deselect user2 for example, the ratio values do not change.  You can see for "Group1", the ratio is still 0.5 where I would like it to display 0.66


      I've attached the workbook for clarification.