Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
vksthkkr
Contributor III
Contributor III

Setting Date as variable in load script

I am setting a variable to a date value in the load script as below

LET vMonth = MakeDate(Year(Today()),Month(Today())-6,1);

At a later point in the script, i am setting a filed in a table using this variable

Load

     *,

     $(vMonth) as Validation_Month

Resident <<Table>>;

While the variable seems to be set properly, the $ sign expansion seems to be returning a value of -21.

Not sure why this is happening.

Labels (1)
1 Reply
sunny_talwar
MVP
MVP

Try this

SET vMonth = Date(MonthStart(Today(), -6));


Load

    *,

    '$(vMonth)' as Validation_Month

Resident <<Table>>;