5 Replies Latest reply on Apr 3, 2018 9:40 AM by Jim Dehner

# Sum of variables across multiple dimensions

Hello! Don't know if I'm explaining this issue accurately via the title, but:

-I have different dimensions in my data for program referrals from a nonprofit -- it's represented as Referral1, Referral2, Referral3, etc. Some entries may have six different referrals, others may have none. The possible types of referrals & their labels don't change (i.e. "preschool" or "support group") but the order they're in & whether or not a referral is given may change.

In its original form in Excel, it would look like this:

Participant ID#Referral1Referral2Referral3
1234Home VisitingPreschoolSupport Group
5678PreschoolWelfare Assistancenull
8909Support Groupnullnull
5545nullnullnull

I can't figure out in Tableau how to get a simple sum of the # of times "Preschool" occurs throughout all the referrals combined. Trying to do a table calculation but can't seem to get it right.

• ###### 1. Re: Sum of variables across multiple dimensions

Hi Kevin

Your data is structured as a wide table - Tableau and other d/b orient programs work best with tall tables

Consider pivoting the data (see the link  Pivot Data from Columns to Rows )

you will have nulls in the data but you have them already - they can be filtered out easily

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• ###### 2. Re: Sum of variables across multiple dimensions

Just use:

IF Referral 2 = Preschool

THEN COUNT

END

+

IF Referral 3 = Preschool

THEN COUNT

END

...

and so on

D

• ###### 3. Re: Sum of variables across multiple dimensions

You just need to Pivot your add Refereeals to make it long data and then you can find easilY;

thanks

Deepak

• ###### 4. Re: Sum of variables across multiple dimensions

Thanks Jim -- was unaware of the power of Pivoting your own data within Tableau! That worked perfectly.

• ###### 5. Re: Sum of variables across multiple dimensions

Thanks Kevin -

Tableau and excel are fundamentally different and each has its own uses - structuring the data as tall thin tables will allow you to use a broader level of the Tableau capabilities

- eg table calculations, pages and uses simple filters in your viz's

if that provided a solution please mark my response helpful or correct