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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

previous record existing

Hi guys,

Could you please with one calculation in a script. In attached qvw example I have two column %userid and register_data. In result, I would like to get column is_repeated which represent 0 or 1 . If current record have previous records where current register_date > previous register_date records for defined userid then 1 else 0. Desired result in picture.

Thank you very much for any help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If your source data already is ordered by register_date you can simply use the exists function:


Load %userid, register_data, if(exists(%userid),1,0) as is_repeated

from ...

If your source data is not ordered by register_date you need to do that first and at the same time you can create the is_repeated field with the previous function.

see attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If your source data already is ordered by register_date you can simply use the exists function:


Load %userid, register_data, if(exists(%userid),1,0) as is_repeated

from ...

If your source data is not ordered by register_date you need to do that first and at the same time you can create the is_repeated field with the previous function.

see attached qvw.


talk is cheap, supply exceeds demand