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: 
Anonymous
Not applicable

Using Variable Names loaded in a Table to display results in a chart

I have created an inline table with embedded variable names. I would like to display the result of the variable in a chart/table.

load script:

Reporting:

Load * INLINE

[

Row_Sort, Row, Variable

1, 'Cy Sales', vCySales

2, 'Py Sales', vPySales

];

I would like to create a tables that shows:

Row                    Variable

Cy Sales               150,056

Py Sales               201,004

Instead I am getting the names.

I've tried a few options like:

=$(=Variable)

=$(Variable)

="$(Variable)"

=[$(=Variable)]

Any ideas?

5 Replies
Anonymous
Not applicable
Author

I've attached a simple example of what I'm trying to achieve.

Cheers.

jerifortune
Creator III
Creator III

May be this video could assist.Adding a variable button in Qlik Sense - Qlik Tuesday and Tricks - YouTube

Another good Tutorial here

Anonymous
Not applicable
Author

Thanks but the question is not around using Variables in Buttons. It's around having it come in as a data value and evaluating the existing Variable based on that value within a chart.

jerifortune
Creator III
Creator III

Try wrap the variable expansion with single quote eg.  '$(Variable)'

Anonymous
Not applicable
Author

Hi

Try below expression:

=if(Variable='vCySales', $(vCySales),$(vPySales))