Skip to main content

Hello everyone,

I'm looking for a solution to restart a RunningSum.

 

I get from customer a number of pulses per day (Pulse)

With Lookup() I can calculate the pulses per day. (Pulse Per Day_)

With this I can calculate a RunningSum. (Pulse over time)

When machine is touched for maintenance(EventCnt) this RunningSum calculation needs to be restarted. I get the information with date and how long maintenance took place - this number varies.

I get the data for number of pulses and information of maintenance via MySql DB - I made a Tableau package with two seperate xls to simulate the case - see attachment.

I made a relationship in Tableau with "Date" for both xls.

 

RunningSum - Restart at vary dates

 

Has somebody an idea how I can restart the RunningSum when an EventCnt took place?

 

Thank you for helping.

 

Nachricht geändert durch Steffen Ermisch

I have changed the twbx for non MySql one.

3 answers
  1. Jun 14, 2017, 7:22 PM

    Steffen,

     

    I cannot open you workbook since it have a connection on a mySql DB,  but you can resolve this using the  PREVIOUS_VALUE function.

    Something like

    if not isnull(EventCtn) then 0 else  [Pulse over time]  + PREVIOUS_VALUE(0) end

     

    Here is an example using superstore,  computing the running_sum  of the  AVG(Sales)  and  restarting  when the SUM(profit)  is negative.

     

    Michel

0/9000