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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Peek function

Hi,

I need to increment with a millisecond for each change of RecordNumber and NRVD, but just when the data is maximum. Like in the sample attached.


Thank you,

Labels (1)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

I succeed to implement. It only needed to use peek(Flag,-1) insead of using peak(Date,-1).

Thank you anyway for your suggestions.

Best regards,

Cosmina

View solution in original post

3 Replies
MarcoWedel
MVP
MVP

Hi,

not quite right, but maybe helpful:

QlikCommunity_Thread_238885_Pic1.JPG

LOAD *,

    Timestamp(Date+(AutoNumber(RecNo(),RecordNumber&'|'&Date)-1)*'00:00:00.001','DD.MM.YYYY hh:mm:ss.fff') as Result;

LOAD RecordNumber,

    NRVD,

    Timestamp#(Date,'DD.MM.YYYY hh:mm:ss') as Date

FROM [https://community.qlik.com/servlet/JiveServlet/download/1155190-252649/Sample.xlsx] (ooxml, embedded labels, table is Sheet1);

Can you elaborate what you meant with "...when the data is maximum." ?

thanks

regards

Marco

Anonymous
Not applicable
Author

Hi Marco,

Thank you for the reply. I loaded the data and haven't got the expected results.

With maximum i meant. Ex. For RecordNumber 1 and NRVD 33, the maximum date is 12.10.2016 so no incrementation needed, because the date for the other RecordNumber 1 and NRVD 33 is less than 12.10.2016.


For RecordNumber 1 and NRVD 2, the maximum date is 10.10.2016 00:10:10, so yes is needed the incrementation for all records with RecordNumber 1 and NRVD 2 and 10.10.2016 00:10:10, as you allready implemented correctly.


For RecordNumber 1 and NRVD 2, the maximum date ist 10.10.2016 00:10:10, so for all RecordNumber 1 and NRVD 2 and date 10.10.2016 00:10:10 i have to apply the incrementation. But not for  the duplicated rows with RecordNumber 1 and NRVD 2 and date 09.10.2016 00:10:20, because 09.10.2016 is less than the maximum date, 10.10.2016. Here i misspelled in the sample 10.10.2016 00:10:20 istead of 09.10.2016 00:10:20.


Also, for RecordNumber 2 and NRVD 33, has to start with milisecond 000, then incrementing.


Best regards,

Cosmina


Anonymous
Not applicable
Author

Hi,

I succeed to implement. It only needed to use peek(Flag,-1) insead of using peak(Date,-1).

Thank you anyway for your suggestions.

Best regards,

Cosmina