4 Replies Latest reply on May 23, 2018 4:33 AM by Yuriy Fal

Percent of First Value using Table Calc (Advanced)

At the risk of oversimplifying the data, I've attached a Tableau 10.5 twbx in order to know how I can use Table calculations to display all data points on the line chart as a percent of the first value (Value1) i.e. 250

So instead of 250, 150 and 100, I want to use Table calcs to show 100%, 60% and 40%. I know one way to do this without Table Calcs would be to actually create an individual percent calculated field for all the 3 values. But in my use case, there's plenty of such individual values and creating a percent field for each will be very painful.

I tried using the "Percent From" Table Calc relative to first value but it is giving weird results.

EDIT

All the 3 Value columns are in reality calculated Tableau fields which I think I cannot Pivot.

Eg: Value1 is calculated as "IF [Duration] >=0 THEN 1 END". And SUM(Value1) comes to 250

Similarly, Value2 is calculated as " IF [Duration] >=30 THEN 1 END"  and the total comes to 150

At a row level, Person A can have '1' for Value1 and '1'  for Value2. So pivoting/combining them would seem infeasible.

• 1. Re: Percent of First Value using Table Calc

HI Amulya

FAQ, and right approach in this case is re-shaping the data.

Thanks,

Shin

• 2. Re: Percent of First Value using Table Calc

Hey Shin, thanks for that solution. I've made an edit to the question to show why I cannot Pivot and perform the Table Calc. I was surprised to see Pivoting as a need for the "Percent From" calc to work because I thought Tableau would perform the table calc on top of the values in the actual view. So I am struggling to understand why the data needs to be long instead of wide for this to work.

• 3. Re: Percent of First Value using Table Calc (Advanced)

It sounds like that's not Tableau's task to create calculated filed, if you struggle to create such many calculated field??.

Anyway, generally speaking, having many measure value is not a good idea.

Tableau like dimensions, or in other words, without dimensions, Tableau does not show power of Viz creation.

Shin

• 4. Re: Percent of First Value using Table Calc

Hi Amulya,

Measure Names / Measure Values can not be referenced in calcs.

One can not use them in Table Calculations (in any Calculations, in fact).

So the brute force method remains, namely,

using a Parameter to chose the 'Baseline' Measure,

and writing a bunch of (simple) aggregations

to compare other Measures to the Baseline.

Please find the attached.

Yours,

Yuri