Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

pdwatt_qlik
New Contributor

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
pdwatt_qlik
New Contributor

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

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

Cheers.

jerifortune
Contributor II

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

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

Another good Tutorial here

pdwatt_qlik
New Contributor

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

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
Contributor II

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

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

arunaerra
Contributor

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

Hi

Try below expression:

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