Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Mean time between repairs..

Hi,

I am struggling with the following problem..

I've got a table containing repairs.. Every records contains a unique repairordernumber, a serialnumber and a orderdate. I would like to calculate the number of days between repairs of each serialnumber. Can someone tell me how to script this?

Thanks, Sander

Labels (1)
1 Reply
rwunderlich
MVP
MVP

Something like:

RIGHT JOIN LOAD DISTINCT *,
if(peek('repairordernumber') = repairordernumber, orderdate - peek('orderdate'), 0) as daysBetween
RESIDENT repairs
ORDER BY repairordernumber, orderdate;

-Rob