Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
VariableName | Expression |
---|---|
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;
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.
Hi
Could you provide a sample file to analysis in detail
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.
It's like digvijay pointed it out the equal-sign '='. See for this also: The Magic of Variables.
- Marcus
Thank you digvijay
Thank you marcus_sommer
I am glad it helped.