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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
JuRoss
Contributor II
Contributor II

variable with conditions

hello im new to qlik sense and i want to create a varible but i dont know the syntax for qlik sense:

in SQL i would write:

Select <tbl1.test> from tbl1 where tbl1.date =getdate()

Can you help me tranlate this to qlik syntax

 

Labels (3)
1 Solution

Accepted Solutions
Aasir
Creator III
Creator III

Create a variable in Master items
as Variable_Name = Only({<tbl1.date={"$(=Date(Today()))"}>} tbl1.test)

you can use this variable in a text object or expression within a chart to display the value

= Variable_Name

This will display the value of tbl1.test where tbl1.date matches the current date.
 

View solution in original post

3 Replies
Mark_Little
Luminary
Luminary

You need to set or let the value

https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegula...

https://help.qlik.com/en-US/sense/August2023/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptRegula...

Then to call depends on if it needs return what is kept in the Variable or evalulated.

vVariable

or

$(vVariable)

JuRoss
Contributor II
Contributor II
Author

thank you for your help

I understand the two diffent types but i still dont no how to set it up.

 

I have:
LET vtest = and now i need the Select <tbl1.test> from tbl1 where tbl1.date =getdate() in Qlik Syntax.

I already know getdate()=Today() but i could need some more help with the rest.

Aasir
Creator III
Creator III

Create a variable in Master items
as Variable_Name = Only({<tbl1.date={"$(=Date(Today()))"}>} tbl1.test)

you can use this variable in a text object or expression within a chart to display the value

= Variable_Name

This will display the value of tbl1.test where tbl1.date matches the current date.