Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
djih
Partner - Contributor II
Partner - Contributor II

calculate time difference between different rows with linked documents

Hello folks,

I have the following challenge. I have to present the time difference between linked receipts. this is how my data looks like:

DateDocNoDocTypeAmountTurnoverQuoteOrderBill
22.01.2019100001Quote2002300100001200001400001
22.01.2019200001Order2002300100001200001400001
24.01.2019400001Bill2002300100001200001400001

In this example all this rows belong to one sales process. 100001 is the initial quote, followed by the order from customer (200001) on the same day. After 2 days the goods are delivered and the bill 400001 is generated. This is why we have the last 3 columns to link the documents.

My target is to calculate the days between each step (from quote to order; from order to bill):

DateDocNoDocTypeAmountTurnoverQuoteOrderBillQuoteToOrderOrderToBill
22.01.2019100001Quote200230010000120000140000102
22.01.2019200001Order200230010000120000140000102
24.01.2019400001Bill200230010000120000140000102

I have tried the following:

QuoteToOrder: Max({<DocType={Order}>}Date) - Min({<DocType={Quote}>} Date)

OrderToBill: Max({<DocType={Bill}>}Date) - Min({<DocType={Order}>} Date)

In the individual rows the result is '-' but if I activate column-results the column result have the correct numbers (0,2). So my basic idea works, but i need the information redundant in each column.

Can anyone help, please?

1 Reply
Brett_Bleess
Former Employee
Former Employee

Christoph, any chance you can attach the QVW on this one?  I suspect that would help you get some responses, as it helps if folks can see the data model you have etc. in order to try to come up with the right way to go at things for the use case.  My post will kick things back up, but my hunch is the QVW would really help in this case.

The best I have to try to help would be the following:

https://community.qlik.com/t5/Qlik-Design-Blog/Canonical-Date/ba-p/1463578

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.