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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to use variables?

Hello, can someone point me out how to declare and use variables?

I was trying to achive something like

SET FirstDayOfTheMonth = Today();

SQL SELECT * FROM MyTable Where Date = FirstDayOfTheMonth

But Im getting an error that says "FirstDayOfTheMonth" field cannot be found.

Thank you ,

Jose.

Labels (1)
1 Solution

Accepted Solutions
Miguel_Angel_Baeyens
Support
Support

Try expanding that variable such as

SQL SELECT * FROM MyTable Where Date = $(FirstDayOfTheMonth)
That should work.

View solution in original post

3 Replies
Miguel_Angel_Baeyens
Support
Support

Try expanding that variable such as

SQL SELECT * FROM MyTable Where Date = $(FirstDayOfTheMonth)
That should work.

avastani
Partner - Creator III
Partner - Creator III

Let FirstDayOfTheMonth = Today();

SQL SELECT * FROM MyTable Where Date = '$(FirstDayOfTheMonth)';

Not applicable
Author

LET is used with expressions and SET with values.