4 Replies Latest reply on Mar 18, 2016 1:31 PM by pooja.gandhi

Divide values of a measure based on their dimension criteria

Hi All,

I am trying to divide the 'Per Member' value below of the test groups by the control i.e In Feb, I need to divide 0.0996/0.0816 for test1 etc. Desired outcome is the 'Lift' column. Is there a way to achieve this in Tableau?

Thanks

 Month Cell Code Per Member Lift Feb-16 Control 0.0816 Test1 0.0996 1.2207 Test2 0.1047 1.2836 Test3 0.0984 1.2069 Mar-16 Control 0.2058 Test1 0.1287 0.6254 Test2 0.1490 0.7239 Test3 1.4857 7.2194 Test4 1.4665 7.1259
• 1. Re: Divide values of a measure based on their dimension criteria

That would be a calculation like this:

sum([Per Member]) / sum({ fixed [Month] : sum(if [Cell Code] = 'Control' then [Per Member] end) } )

• 2. Re: Divide values of a measure based on their dimension criteria

If you need the 1st cell to be blank, you can add the NOT equal to condition in the numerator:

• 3. Re: Divide values of a measure based on their dimension criteria

Thanks Pooja, this worked.

What if I had multiple fields which need to be be fixed? See below

Thanks again

• 4. Re: Divide values of a measure based on their dimension criteria

Brenda - you could add the dimension 'class' to the FIXED expression.

1 of 1 people found this helpful