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: 
pawe84
Creator
Creator

conditional table drop

Hi everyone,

how I can set up a conditional table drop.

For example:

If the current date equals January 1st all data of a table have to be deleted .

All other days data will only be inserted into the table.

Can I use tReplicate and two DBOutput?

Thanks for any advice.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hello,

With the action performed by DROP , you could use a select query in the same DB table to check whether the table can meet your condition and assign it to a context variable and then have an RunIf trigger from t<DB>Input where you can test the globalMap variable created to see if it's >0 and so trigger t<DB>Row to delete table if you want.

Best regards

Sabrina

 

View solution in original post

3 Replies
Davis69
Contributor III
Contributor III

WHERE clause mainly used along with the DELETE command. No clause required along with DROP command. Actions performed by DELETE can be rolled back as it uses buffer. Actions performed by DROP can't be rolled back because it directly works on actual data.

 

Anonymous
Not applicable

Hello,

With the action performed by DROP , you could use a select query in the same DB table to check whether the table can meet your condition and assign it to a context variable and then have an RunIf trigger from t<DB>Input where you can test the globalMap variable created to see if it's >0 and so trigger t<DB>Row to delete table if you want.

Best regards

Sabrina

 

Jfoster1657625676
Contributor II
Contributor II

Thanks for sharing. It is clear for me