Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
ID | Amt | Date | Flag |
---|---|---|---|
1 | 100 | 01/01/2016 | ORD |
2 | 200 | 02/01/2016 | ORD |
1 | 100 | 10/01/2016 | DEL |
2 | 200 | 11/01/2016 | DEL |
I have the above table
i want the difference between dates
like Order Date (ORD) - Delivered Date(DEL) in Days or Hrs
How can i get the Difference?
Can anyone help me ?
thanks in advance
Take care that your dates are correctly interpreted in your load script (e.g. by using the default format code
SET DateFormat = 'DD/MM/YYYY'; // or 'MM/DD/YYYY' ?
Then you can create a chart with dimension ID and as expression:
=Interval( Sum({<Flag = {ORD}>}Date) -Sum({<Flag = {DEL}>}Date), 'D')
resp.
=Interval( Sum({<Flag = {ORD}>}Date) -Sum({<Flag = {DEL}>}Date), 'h')
edit:
I think you want to calculate DEL-ORD, hence
=Interval( Sum({<Flag = {DEL}>}Date) -Sum({<Flag = {ORD}>}Date), 'D')
edit2: Replaced Only() with Sum(), so you can also get totals.
Take care that your dates are correctly interpreted in your load script (e.g. by using the default format code
SET DateFormat = 'DD/MM/YYYY'; // or 'MM/DD/YYYY' ?
Then you can create a chart with dimension ID and as expression:
=Interval( Sum({<Flag = {ORD}>}Date) -Sum({<Flag = {DEL}>}Date), 'D')
resp.
=Interval( Sum({<Flag = {ORD}>}Date) -Sum({<Flag = {DEL}>}Date), 'h')
edit:
I think you want to calculate DEL-ORD, hence
=Interval( Sum({<Flag = {DEL}>}Date) -Sum({<Flag = {ORD}>}Date), 'D')
edit2: Replaced Only() with Sum(), so you can also get totals.
hi swuehl
thanks for reply
but
how can i show in Report ?
how can i display the following table
id | Amt | ORD Date | DEL Date | Difference between ORD and DEL Date
1 | 100 | 01/01/2016 | 10/01/2016 | 274
ID | Amt | Only({<Flag = {ORD}>}Date) | =Only({<Flag = {DEL}>}Date) | =Interval( Sum({<Flag = {DEL}>}Date) -Sum({<Flag = {ORD}>}Date), 'D') |
---|---|---|---|---|
548 | ||||
1 | 100 | 01/01/2016 | 10/01/2016 | 274 |
2 | 200 | 02/01/2016 | 11/01/2016 | 274 |
thanks