Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
abc_18
Creator II
Creator II

How to use flag along with ID for incremental logic

Hello ,

I have to write an incremental logic based on ID and flag.

I am using date>modified date and for update using not exist (ID), but how to use flag along with that as flag is also getting update as Y or N based on update data.

How can I use this?

Thanks

Labels (1)
3 Replies
aapurva09
Creator
Creator

Hi,

it would be helpful if you share some dummy data to understand your requirement better.

thanks

abc_18
Creator II
Creator II
Author

For example below is the data set:-

IDabKeySalesFlag
14594_5_9Y
23683_6_8Y
3257725_7_7Y

 

here ID field is incremental, now next day another record is being added, with a flag value as N, and first row of data is updated:-

IDabKeySalesFlag
14594_5_9Y
23683_6_8Y
3257725_7_7Y
44594_5_9N

 

so to update the data in qlik, I will write where not exist(Key), but without flag it will not recognize that ID number'4' is a new records, so I have to include flag logic as well, because records are being updated based on that.

aapurva09
Creator
Creator

If I understood right, for each record if the Flag is 'N' its a new record, 'Y' is old. If this is correct, i would do the following:

  • Load today's table where we get records with Flag 'N' only and not exist(Key).
  • Replace Flag value from 'N' to 'Y'
  • Concatenate with existing qvd (your 1st table in the example).

Hope this helps

Thanks