Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
anon
Contributor
Contributor

Difference between Dates in the Same Field

Hello all,

 

I have the following fields:

ITEM_NO,

CUSTOMER_NO,

QUANTITY_SHIPPED,

and SHIP_DATE.

 

I am attempting to create a measure that will show allow me to calculate the average and standard deviation of the number of days between the ship date and the previous ship date. The problems I have faced are as follows: When filtered by ITEM_NO and CUSTOMER_NO, the SHIP_DATE are irregular. i.e. the last most recent date could be 7/18/2019 and the second most recent could be 6/11/2019. Thus, I would want the difference between these dates to be 37. I was able to create a measure named DAYS_UNTIL_NEXT_SHIPMENT that is ABOVE(TOTAL(SHIP_DATE))- SHIP_DATE which works very well. However, I am not able to take the average and standard deviation of this measure to put into a different table. 

 

Any feedback would be greatly appreciated.

 

 

 

1 Reply
anon
Contributor
Contributor
Author

So this is a capture of a data selection. This is filtered for only one item and customer number. In the data load editor, I set Date(Previous(ship_date), 'mm/dd/yyyy') as 'Prev'. however, It is obviously not correct. The total shown at the top of the DAYS_UNTIL_NEXT_SHIPMENT is the average and is correct. However, I can not take the average of the measure and use it as its own measure to put into a different table.