Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: previous record existing

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
1 Reply

Re: previous record existing

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
Community Browser