Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Do More with Qlik - for Beginners and Beyond, Topic: Qlik Replicate on January 21, 2PM EST. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression Variable not working in charts

Hi Guys,

I am using Variables as expressions and I am having following problem :

When I type =vTotalOrder in the text box then it shows me expected total number of orders as '400'

But when I use the same variable in the expression definition box of a straight table and select any dimension like customer or sales rep or city then it shows me 400 for every customer!

I have imported variables from an excel spread sheet that looks like below

VariableNameExpression
vTotalOrder=count(Distinct(@OrderId))

And then.. I am using following in the load script

// Loading variables from Excel Spreadsheet


Expressions:

LOAD Variable,

      Expression


FROM $(vG.MetricsRoot)\Expressions Ops.xlsx

      (ooxml, embedded labels, table is Sheet1);

// Setting variables the above table


For i = 0 to NoOfRows('Expressions')-1

          LET vName = Peek('Variable', i, 'Expressions');

          LET $(vName) = Peek('Expression', i, 'Expressions');

Next i

LET i = Null();

vName = Null();

Drop Table Expressions;

1 Solution

Accepted Solutions
Master III
Master III

Can you try with no '=' sign in the excel definition, it appears as it is calculated once and used the same value every where, without '=' it should be interpreted dynamically in the chart based on selections.

View solution in original post

6 Replies

Hi

Could you provide a sample file to analysis in detail

Thanks & Regards,
Mayil Vahanan R
Master III
Master III

Can you try with no '=' sign in the excel definition, it appears as it is calculated once and used the same value every where, without '=' it should be interpreted dynamically in the chart based on selections.

View solution in original post

MVP & Luminary
MVP & Luminary

It's like digvijay pointed it out the equal-sign '='. See for this also: The Magic of Variables.

- Marcus

Not applicable

Thank you digvijay

Not applicable

Thank you marcus_sommer

Master III
Master III

I am glad it helped.