Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Frédéricdh
Creator II
Creator II

Variable

Hello,

I crete an Button where I set a variable like this REF = 26222

and in the script i write this REFNUM = $(REF) but it doesn't work, the srcipt don't find a value or the REFm why?

Labels (1)
4 Replies
marksouzacosta
Partner - Specialist
Partner - Specialist

Hi @Frédéricdh,

Would be nice to see exactly what you do have typed in your Load Script and what do you have on your UI. I'll give you an example:

The first Action of this button set the value of a variable vRunningTask:

marksouzacosta_0-1718632576040.png

These are the variables in the Variables window:

marksouzacosta_2-1718632807878.png

 

And this is how I called in the Load Script:

marksouzacosta_1-1718632647743.png

You are probably missing something in your Load Script. How are you setting your variable? What is the code? I believe it should be something like:

SET REFNUM = '$(REF)';

 

Read more at Data Voyagers - datavoyagers.net
Frédéricdh
Creator II
Creator II
Author

I define my Variable like that:

Frdricdh_1-1718699927541.png

 

AND in MY SQL, I use the variable like that

WHERE

XBRA.XBREFNUM = $(REF)

 

If i write this '$(REF)', Qlikview use it like a string, no?

 

 

marksouzacosta
Partner - Specialist
Partner - Specialist

Try XBRA.XBREFNUM = $(Ref) instead.

Qlik is case sensitive. That is why it is not finding REF (uppercase).
Regarding your question, yes, if you use single quotes, it will be considered strings otherwise will try to use it as a numeric value. If it is numeric, you are good.

Read more at Data Voyagers - datavoyagers.net
Frédéricdh
Creator II
Creator II
Author

No it doesn't work 

😞