Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Sasi3557
Contributor II
Contributor II

Deleting and updating data

Hi qliksense experts

 

I have incremental data with only month specified. I need to delete the last 30 days data and update all the data including present date.

lets say i have data till today(2019/09/11). As i dont have the date specified and its last 30 days data to be deleted and updated. If the present date is <30 i need to delete the last month data till present data and update till present date again.

 

any ideas.

 

 

Labels (1)
5 Replies
jerifortune
Creator III
Creator III

In your script, create a variable

LET vLast30Days= Date(now(1)-30);

On your script

LOAD...................
WHERE ORDERDATE < '$(vLast30Days)'


Try to ensure that ORDERDATE and vLast30Days are in the same date format

Sasi3557
Contributor II
Contributor II
Author

Hi

 

but i don’t  have the order date in my table i only have the month. So if its 15 of this month and if i load the data tomorrow it should delete last months and present month data and load all the data till tomorrow as the data would change depending on the trigger 30 days /20 days

jerifortune
Creator III
Creator III

I used order date as an example. Do you have a date column?  OR Do you have only month and year?



Sasi3557
Contributor II
Contributor II
Author

I have month column and year column thats it.

jerifortune
Creator III
Creator III

WHERE

Date(Monthend(makedate([Year],[Month]))) < '$(vLast30Days)'