Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone!
I didn't found a solution of my problem in the forums, so, I tried to post this issue here:
I need to calculate the time between n dates in rows (TimeLapsed column). I make this example in excel, but i need to resolve it in Qlikview to obtain aggr data by Area.
Example:
AreaWorkflow | ChangeDate | Status | TimeLapsed |
MKT - Especialidades | 06/05/2010 12:42 | Started | NULL |
MKT - Especialidades | 06/05/2010 12:43 | Area Revision | 0,00 |
Impuestos | 21/06/2010 22:37 | Legal Revision | 46,41 |
Asuntos Corporativos y Legales | 19/07/2010 10:22 | Aproved to Sign | 27,49 |
MKT - Especialidades | 19/07/2010 10:23 | Sign off | 0,00 |
MKT - Especialidades | 19/07/2010 10:23 | Aproved | 0,00 |
Asuntos Corporativos y Legales | 19/07/2010 16:39 | Finish | 0,26 |
Thanks in advance,
Sebastián.
I'd recommend calculating Time Lapsed in the load script and not in the chart expression. You need to use functions peek() and previous() to calculate the "current" and the "previous" values of the timestamp.
Hi Sebastian,
You may use inter record functions:
ChangeDate - Above(ChangeDate)
Is that what you mean?
Yes, but I need to use an aggregation function if I'll use ChangeDate-Above(ChangeDate) this formula as expression return - (error).
Is correct in the theorical way, but Qlikview respond in negative form.
Thanks in advance,
Sebastián.
Hello Sebastián,
This probably has to do with your date formatting. Something like (untested)
Interval(Date(ChangeDate) - Date(Above(ChangeDate)))
might work. If it doesn't create a new column just with
just to check which value is your chart taking.Above(ChagneDate)
Hope that helps.
Hi Miguel,
Thanks for your answer but when i try to use Above function, it returns - because the parameter must be an aggregation function.
Regards,
Sebastián.
I'd recommend calculating Time Lapsed in the load script and not in the chart expression. You need to use functions peek() and previous() to calculate the "current" and the "previous" values of the timestamp.
I agree with Oleg's recommendation. Something like this:
LOAD
SomeID
,AreaWorkflow
,Status
,ChangeDate
,if(SomeID=previous(SomeID),interval(ChangeDate-previous(ChangeDate))) as TimeLapsed
...
John / Oleg,
Thanks in advance for your answer. It works ok and it improves the calculating time in the user document.
Good Weekend,
Sebastián.