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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
clausbarlose
Contributor III
Contributor III

Open workorder statistics

Hi – hoping for help on this one!

I have a QV file with workorders:

ID
CreatedDate
ClosedDate

for which I want to calculate how many orders are active on a given date. The definition of an active order is that the CreatedDate >= date in question and date in question <= ClosedDate.

My thought was to generate a new table:

ID
StatDate

- to be able to count the number of IDs on a specific date, but I am having difficulties having this work as reading from one table and autogenerating dates in another table.

Does anyone have a suggestion on how to do this? I have attached an example file with workorders.

BR

Claus

11 Replies
MarcoWedel

one example:

QlikCommunity_Thread_295664_Pic1.JPG

tabWO:

LOAD ID,

    CreatedDate,

    ClosedDate,

    AutoNumberHash128(DayName(CreatedDate),Alt(DayName(ClosedDate),Today())) as IntervalID

FROM [https://community.qlik.com/servlet/JiveServlet/download/1457383-319354/SampleWorkorders.xlsx] (ooxml, embedded labels, table is Sheet1);

tabDates:

LOAD Distinct

    IntervalID,

    DayName(CreatedDate,IterNo()-1) as Date

Resident tabWO

While CreatedDate+IterNo()-1 <= Alt(ClosedDate,Today());

regards

Marco

clausbarlose
Contributor III
Contributor III
Author

Hi Marco

Thank you! I've checked a few dates and it seems to compute. I have changed the code a bit to understand it, and reckon that the autonumberhash128 is due to memory conservation?

My question has been answered.

Br,

Claus