5 Replies Latest reply on Aug 29, 2017 7:28 AM by Hari Chandan Reddy Maryada

# "Conditionally Aggregating by a Dimension not in the View When Using Another Table Calculation Filter" Multiple Grand Totals

Hi all,

I recently stumbled across the following article: Conditionally Aggregating by a Dimension not in the View When Using Another Table Calculation Filter | Tableau Software

Essentially, I am able to conditionally aggregate via a calculated field that, when filtered on, hides all instances where the condition is not met. Then, through window sums, I can sum the relevant fields over the proper recurring intervals such that all entries for each instance of the primary pill in the row column have the same sum, despite having different fields in the secondary pill. Lastly, each instance of the secondary pill is assigned a unique count (which resets every instance of the primary pill), so that when that field is filtered to only allow the number 1, there will be only one instance of the correct total, and the others will be hidden.

That being said, I am unable to use a grand total with this approach; there are multiple identical (correct) grand totals at the bottom of the table--one for each of the "subsets." While the count filter approach leaves only one instance of each unique sum, it doesn't filter the grand totals. I included a packaged workbook that follows the instructions in this article exactly and then adds a grand total at the bottom for reference.

Is there any way to eliminate the multiple grand totals or, alternatively, compute those grand totals in another table? Really struggling with an approach, here.

• ###### 1. Re: "Conditionally Aggregating by a Dimension not in the View When Using Another Table Calculation Filter" Multiple Grand Totals

Hi Nathanael,

Is this what you are expecting:

3 of 3 people found this helpful
• ###### 2. Re: "Conditionally Aggregating by a Dimension not in the View When Using Another Table Calculation Filter" Multiple Grand Totals

Yes! What did you do?

• ###### 3. Re: "Conditionally Aggregating by a Dimension not in the View When Using Another Table Calculation Filter" Multiple Grand Totals

Hi,

Just hide the Corporate:

and uncheck the show header on segment

3 of 3 people found this helpful
• ###### 4. Re: "Conditionally Aggregating by a Dimension not in the View When Using Another Table Calculation Filter" Multiple Grand Totals

Thanks so much.

Will this approach still work if there is no data in the consumer column, though? For example, what if all of the information was in the corporate and home office segments, and corporate is the only one that isn't excluded?

• ###### 5. Re: "Conditionally Aggregating by a Dimension not in the View When Using Another Table Calculation Filter" Multiple Grand Totals

I guess it will not work in that scenario as we are manually hiding the column. Will definitely look into it for workaround.

3 of 3 people found this helpful