Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
anupam08
Contributor
Contributor

Calculation

Hi 

i have data in table as follows 

product   status     date

1234         Created  12/4/2018

1234      Submitted 12/5/2018

1234       Approved 12/6/2018

how to calculate the day difference between the date of the product (for one transaction ie created to approved)

regards 

Anupam

3 Replies
chrismarlow
Specialist II
Specialist II

Hi,

How you start this depends if you want to do this in script or a chart.

Suggestion for getting a starting point for a chart would be to use Only & Set Analysis, so;

20210709_1.png

Should then be fairly straightforwrd to get the difference.

Suggestion for starting in script would be toy script below. You would then either use the new date fields in a chart to get difference, or manipulate further in code.

Cheers,

Chris.

data:
Load * Inline [
product,   status,     date
1234, Created,  4/12/2018
1234, Submitted, 5/12/2018
1234, Approved, 6/12/2018
];

left join (data)
Load 
	product,
    'Created' as status,
    date as approved_date
Resident data
where status='Approved';

 

anupam08
Contributor
Contributor
Author

Hi
I want that in chart using set analysis
chrismarlow
Specialist II
Specialist II

Hi,

Then is the top one using Only, or similar.

Cheers,

Chris.