5 Replies Latest reply on Oct 13, 2016 10:03 AM by Thomas Gaffney

# Hierarchical Structure / Buckets / Totals

Hello-

I am attempting to create a calculated field that will allow me to show a Total for ***** side by side with a total for Soccer ***** and Baseballs.  My data is organized in a hierarchical structure and cannot be changed.

TH1=*****

TH2=Soccer Ball, Baseball

TH3=Red, Yellow, Blue

Currently I can use field TH2 to show totals for soccer and baseballs, but cant get a grand total. Or, I can use field TH1 to show a grand total, but can't get the split between soccer and baseballs.

Is there a way to bucket data into one field when you are dealing with a hierarchical structure? I tried an if/then statement, but I assume it is not working as Tableau would default all three conditions below into the 'Total *****' bucket.

If TH1 ='*****' then 'Total *****' ELSEIF

TH2 ='Soccer Ball' then 'Soccer Ball' ELSEIF

TH2 = 'Baseball' then 'Baseball' Else

'Other'

End

Thank you!

• ###### 1. Re: Hierarchical Structure / Buckets / Totals

Hi Thomas,

This one is a bit tricky to fully comprehend, could you attach a workbook with some sample data and an example of your ideal output?

-Ryan

• ###### 2. Re: Hierarchical Structure / Buckets / Totals

Hi Thomas,

Thanks,

Sreekanth.

• ###### 3. Re: Hierarchical Structure / Buckets / Totals

Thank you Ryan and Sreekanth. I hope the attached helps to illustrate what I am trying to do.

• ###### 4. Re: Hierarchical Structure / Buckets / Totals

Hi Thomas,

Thanks for the workbook.

Calculation1

IF TH2 = 'Soccer' then 'Soccer Ball'

ELSEIF TH2 = 'Baseball' then 'Baseball'

ELSE 'Other'

End

If yow want totals in a view go to analysis > Totals

Thanks,

Sreekanth.

• ###### 5. Re: Hierarchical Structure / Buckets / Totals

Thank you, Sreekanth. Your help is most appreciated, and this accomplishes what I wanted. I was somehow hoping to do it in a calculated field, but apparently, no need .

Thanks again!

Tom