Hi All,
I'm a newbie here. I have a column called 'Value' and I want to divide all the rows in that column with the first value in that column. I want to calculate cumulative capacity on the x-axis. How can I create a calculated field called 'cum_cap' and 'cap_percentage'. The '(value*100)/4503.41611' (as you can see I have hardcoded the value here). How can I achieve this in Tableau?? I am not sure how to use the Lookup feature here. Any help is much appreciated. Thanks!
Below is the reference table:
capacityvalue ------>capacity/100cum_cap (diagonal addition)Cap_percentage --> (value*100)/4503.41611'4503.416114.503416114.50341611450.34/4503.416114503.964314.503964319.00738042 --> (4.50341611+ 4.50396431)450.39/4503.416114504.525824.5045258213.51190624 --> (9.00738042+4.50452582)450.45/4503.416114503.520844.5035208418.01542708 -->(13.51190624+4.50352084)450.35/4503.41611............... and so on ......
Basically, how can I create a calculated field for cum_cap & cap_percentage ?? How to tell tableau to Lookup for the first value in the capacity column and divide by value to achieve cap% field?? Also, how to derive the cum_cap field as well?
Thank you in advance. Please, guys, help me here.
Hi Shraddha,
Greetings and here is my solution. I have also attached the twbx and excel workbook below.
Also I noticed some typos in your formula that almost had me confused (which I did try and diffuse ).
Value = Capacity/100and 4500/100 = 45 (not 4.5)
This also led to a confusion later on where you multiply
the Value (you actually divided by 1000) with 100
Also Cap % is simply [Capacity] / { MIN ( [Capacity] ) }
using a LOD calculation.
Anyway, I have attached the twbx file below and do let me know if you have any questions or need
further clarification. Also I hope I didn't get it all wrong "errare humanum est" (pardon my Latin).
Take care and Best wishes !
Sincerely,
Soumitra