Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
dineshsingh
Partner
Partner

Qlik Sense: How to create a variable that can be used at front end?

Please suggest a way to create variables without calling generic objects API.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

The expression only(Date) is meaningless in the script. It will evaluate to Null and that means the variable won't exist after the script is finished. Perhaps you want to create a variable in the script containing the expression Only(Date) and you want to use that in the front end. If so you need to use SET instead of LET: SET vSelectedDate = Only(Date);. You can then create a measure to use the variable: =$(vSelectedDate)


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
Gysbert_Wassenaar

Create them in the Data load editor:

SET vMyVariable = 1;

Then reload the document.


talk is cheap, supply exceeds demand
dineshsingh
Partner
Partner

Thanks Gysbert,

Can we use LET instead of SET in case when we have to first evaluate expression?

Gysbert_Wassenaar

Yes, you can use LET too.


talk is cheap, supply exceeds demand
engishfaque
Specialist III
Specialist III

Dear Dinesh,

SET => Just assign value to the variable as a literal.

LET => First Evaluate the expression and then assign to variable.

Kind regards,

Ishfaque Ahmed

dineshsingh
Partner
Partner

Main.jpg

I got problem in using LET. I have described my problem in the image above, please help me.

Gysbert_Wassenaar

The expression only(Date) is meaningless in the script. It will evaluate to Null and that means the variable won't exist after the script is finished. Perhaps you want to create a variable in the script containing the expression Only(Date) and you want to use that in the front end. If so you need to use SET instead of LET: SET vSelectedDate = Only(Date);. You can then create a measure to use the variable: =$(vSelectedDate)


talk is cheap, supply exceeds demand

View solution in original post

dineshsingh
Partner
Partner

Dear Gysbert,

Thanks for the reply. Can you please suggest an solution for the same.