
1. Re: Calculate a running sum on rows if current row is 1 else default to 0
Norbert Maijoor Dec 14, 2016 5:29 PM (in response to Kwesi Enninful)Hi Kwesi,
Find my approach as reference below and stored in attached workbook version 9.3
Running sum adj.: if attr([Value])<=0 then 0 else sum([Value])+PREVIOUS_VALUE(0) END

Running_Sum Adj.twbx 15.0 KB


2. Re: Calculate a running sum on rows if current row is 1 else default to 0
Kwesi Enninful Dec 15, 2016 9:13 AM (in response to Norbert Maijoor)Hi Norbert, Thanks for responding. The example you provided uses table calculation. I am looking for an approach that does not use table calculation.
Thanks,
Kwesi

3. Re: Calculate a running sum on rows if current row is 1 else default to 0
Norbert Maijoor Dec 15, 2016 9:19 AM (in response to Kwesi Enninful)Hi Kwesi,
Nor sure what you meant "does not use table calculation"....How would you like to achieve this without using a "Calculation field" or table calculation?

4. Re: Calculate a running sum on rows if current row is 1 else default to 0
Kwesi Enninful Dec 15, 2016 9:27 AM (in response to Norbert Maijoor)Hi Norbert,
I would like to use a calculation field instead of table calculation. Basically, I want to aggregate the data further and roll it up to a higher level using the level of detail (LOD) functions in tableau such as Fixed or Include function. Table calculation does not support level of detail functions and that is why I'm looking for another approach which supports LOD.
Thanks,
Kwesi

5. Re: Calculate a running sum on rows if current row is 1 else default to 0
Norbert Maijoor Dec 15, 2016 9:38 AM (in response to Kwesi Enninful)Hoi Kwesi,
Could you share the workbook with the complete scenario?

6. Re: Calculate a running sum on rows if current row is 1 else default to 0
Kwesi Enninful Dec 16, 2016 8:11 AM (in response to Norbert Maijoor)Hi Norbert,
Please see attached. On sheet 2, I would like to count department id which have a running sum of at least 4 and over without showing department id. I can accomplish this if I use level of detail function in tableau but the challenge is that level of details is not compatible with table calculation. That is why I would like to perform the rolling sum using a different function which is not table calculation.
Thanks for your help.
Kwesi

Example Data.twbx 127.1 KB
