Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
New 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
Highlighted
Contributor III

Re: Deleting and updating data

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

Highlighted
New Contributor II

Re: Deleting and updating data

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

Highlighted
Contributor III

Re: Deleting and updating data

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



Highlighted
New Contributor II

Re: Deleting and updating data

I have month column and year column thats it.

Highlighted
Contributor III

Re: Deleting and updating data

WHERE

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