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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
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
Partner Ambassador/MVP
Partner Ambassador/MVP

Something like:

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

-Rob