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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Timestamp; difference between rows

Hi

Have treid to follow the different threads but cannot get them to work 😞

In example below i have actions started and finished with commom TU name. I want to make a trend to show the actual time between start and finish for each TU.

Should i do this in excel before import or can i do it in Qlikview.

I only have persnal edition..

   

CreatedActionTU NameLocation
2017-07-10 10:21:22.120FINISHED599999990002694000PG02WP45
2017-07-10 10:22:56.165STARTED599999990002694000PG02WP45
2017-07-10 10:31:06.370FINISHED599999990002787000PG02WP42
2017-07-10 10:33:52.375STARTED599999990002787000PG02WP42
2017-07-10 09:32:30.543FINISHED599999990003059000PG01WP43
2017-07-10 09:34:54.552STARTED599999990003059000PG01WP43
2017-07-10 10:17:56.165FINISHED599999990003168000PG03WP45

Thanks

/des

4 Replies
m_woolf
Master II
Master II

Load

     Created,

     Action,

     [TU Name],

     If([TU Name] = peek('TU Name'),Created-peek('Created')) as ElapsedTime

from ....

order by [TU Name], Created;

Anonymous
Not applicable
Author

Hi

Tried that but did not get desired result. Just got errors when i tried to add the script as you suggested but here i got some results.

However the elapsed time for each event was over 23 hours.

Attached the file so you can see.

LOAD *,
Month(Date) As Month,
Year(Date) As Year,
Day(Date) As Day,
Hour(Created) As hour,
Minute(Created) As Min;
LOAD Date(Floor(Created)) as Date,
Created,
Action,
[TU Name],
Location,
[Super TU],
TargetList,
[Target Location],
[Transport Order],
[Transport order type],
[Transport Error Code],
If([TU Name] = peek('TU Name'),Created-peek('Created')) as ElapsedTime

FROM

(
ooxml, embedded labels, table is [pallet in_1]);

Kushal_Chawda

You should have order by clause to work the logic correctly

Data:

LOAD Date(Floor(Created)) as Date,
Created,
Action,
[TU Name],
Location,
[Super TU],
TargetList,
[Target Location],
[Transport Order],
[Transport order type],
[Transport Error Code]
FROM

(
ooxml, embedded labels, table is [pallet in_1]);


Final:

noconcatenate

LOAD *,

        If([TU Name] = peek('TU Name'),Created-peek('Created')) as ElapsedTime

Resident Data

order by [TU Name], Created;


drop table Data;

         

Anonymous
Not applicable
Author

Hi

Get the following

Then

Copied in your suggestion

LOAD *,

      Month(Date) As Month,

      Year(Date) As Year,

      Day(Date) As Day,

      Hour(Created) As hour,

      Minute(Created) As Min;

LOAD Date(Floor(Created)) as Date,

Created,

Action,

,

Location,

,

TargetList,

,

,

,

FROM

(ooxml, embedded labels, table is );

Final:

noconcatenate

LOAD *,

        If( = peek('TU Name'),Created-peek('Created')) as ElapsedTime

Resident Data

order by , Created;

drop table Data;