Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello friends of the qlik community,
I have 2 rows, with 2 times. But i only want to keep the row with the earliest time. Can this be accomplished by using set analysis? I attached an example below.
thanks in advance!
I can't open the image for some reason, but if you only want to keep the first row in the load script you can either:
Load
Dim1,
Dim2,
timestamp(min(TimeField)) as TimeField // timestamp() or whatever fits
from <source> group by Dim1, Dim2;
This will be a heavy calculation if you have many dimensions (Dim1, Dim2). In this case I would instead read the table using peek() and flag the first row for each key (Lets call it Dim1):
Tmp:
Load
Dim1,
Dim2,
// Many more fields
if(Dim1<>peek(Dim1),TimeField) as TimeField
from <source> order by Dim1, Timefield asc;
Data:
noconcatenate Load * resident Tmp where not isnull(TimeField);
drop table TimeField;