Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Load only last X months - using a variable

Hi,

I want to load only data since last 3 months,

so in the script, I am using:

Let vLast3Months = AddMonths(today(),-3);

Table:

LOAD CampaignID,

          CreationDate as [ExportDate]

FROM XXX

WHERE CreationDate>=$(vLast3Months);   // I use $() since it's a date variable

But it's not effecting my load, what's wrong?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

My guess is the date format. Try converting it to a number:


Let vLast3Months = num(AddMonths(today(),-3));


talk is cheap, supply exceeds demand

View solution in original post

1 Reply
Gysbert_Wassenaar

My guess is the date format. Try converting it to a number:


Let vLast3Months = num(AddMonths(today(),-3));


talk is cheap, supply exceeds demand