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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Before load record

Hi All,

I have a little problem when I am loading a table from a file.

I want to the save the value of the old before read record, however regarding a particular code. How is this??, as below example, for code IM2010-1234, I need to save in "Previous Date" field the value of the last date which belongs to IM2010-1234. i.e. for the first read it would be empty.

For the second IM2010-1234, I would use "exists" to check if I read it or not, if YES, then I want to get date 18/05/2009 which is the one from the first one and put it on field "Previous Date" of the second one.

For the third one same (get the last date read it), however move the one from "Previous Date" to "Before Date", and put the last read (from before) in "Previous Date." Got me??

I cannot use function "before" as that is only for the immediate record before.

Any ideas??

Many Thanks in advance.

Mauricio

CODEDatePrevious DateBefore Date
IM2010-123418/05/2009
IM2010-887717/10/2009
IM2010-444421/10/2009
IM2009-334423/11/2009
IM2010-123418/12/2009
IM2010-999921/12/2009
IM2008-987605/01/2010
IM2008-987706/01/2010
IM2010-887709/01/2010
IM2010-123413/01/2010
4 Replies
happydays1967
Creator
Creator

Mauricio,

I would use the 'lookup' function for this (refer to the help file for syntax). this will allow you to get the value of a field in a specific row in a specific tabele. First to calculate the 'Before date' and then to populate 'previous date'. you could use the 'max' function to get the highest previous date for the id. I have not tested this for this particular scenario, but if you play around with it a bit, you can probably figure it out.

Not applicable
Author

when you are loading data sort it by Code, Date Asc and utilize previous() fucntion.

If you explain this bit (I am confused):

For the third one same (get the last date read it), however move the one from "Previous Date" to "Before Date", and put the last read (from before) in "Previous Date." Got me??

then I can send you an example script.

Karol

Not applicable
Author

Dear Hans,

Mnay thanks for your tip, I will try and check.

Again, many thanks.

Mauriccio

Not applicable
Author

Dear Karol,

Yes, I will try that. Actually you have gave me another good idea to do so.

Many thanks again!!!

Mauriccio