Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

urban_hedlund
New Contributor III

Variables

How do I show variables from load script in a visualization?

Tags (1)
1 Solution

Accepted Solutions
jsakalis
New Contributor III

Re: Variables

I see the following. The contents of the variable:

Capture1.PNG.png

6 Replies
jsakalis
New Contributor III

Re: Variables

Hi Urban,

     Create a Text & Image object. For the text enter:

          =LongMonthNames

     This will display the value of a default variable that is created by the editor. You can reference any other variable that you create in a script in the same manner, using any other object.

     If you are looking for displaying all variables from a script, not sure if there is a trick to do this quickly, without resorting to some fancy scripting (to put name/value pairs in a table for display in a table object). But if you have a few variables you want to keep on eye on, you can string them together

     ='Var1: ' & Var1 & 'Var2:' & Var2 ....

     If you are debugging, check out the debugger in the data load editor, this shows you the values for each variable as the you are stepping through your script.

     Hope this helps.

urban_hedlund
New Contributor III

Re: Variables

Hi

I don´t get it. I create a Text & picture and enter =LongMonthNames (orother name of variable from the script)

When I activate the app it  shows the variable name (=LongMonthNames)

jsakalis
New Contributor III

Re: Variables

I see the following. The contents of the variable:

Capture1.PNG.png

jsakalis
New Contributor III

Re: Variables

Appears as follows when running:

Capture2.PNG.png

Employee
Employee

Re: Variables

depending how you defined the variable you may need to invoke it with the $() notation.

SET  vSales = sum(Sales);

Invoke like this in the text/image object:

=$(vSales)

urban_hedlund
New Contributor III

Re: Variables

I tried that earlier, without luck. Did something else wrong the first time.

Works now.

Thanks