Hello all, would appreciate someone helping me with this calculation, I am a new Tableau user self learning.
I have the following source, I need to make a new calculated field in source where it calculates the time spent of each Order Outlet ID from its previous order status.
Created Date, which contains time also, is basically the Time stamp of the record.
The records for each Order outlet ID are not under each other, many can be in between.
The calculation must do the following
for every Order Outlet ID
calculate the difference (convert to minutes) of the Created Date & Time Field (timestamp)
for the previous Order Status for that same Order Outlet ID (Order Status -1)
of course those with order status =1 won't have a value since no previous value, so must be zero.
Appreciate your help!
Hello Ala,
Time Difference:
IF FIRST()=0 THEN 0 ELSE
LOOKUP(ATTR([Created Date]),0)-LOOKUP(ATTR([Created Date]),-1) END
Format as h:mm:ss - Also this is a table calculation so the settings for it should be (right-click the pill and select Edit Table Calc):
Number of Minutes:
[Time Difference]*(60*24)
Returns the following for the example Order Outlet ID's:
Best, Don