Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Community,
I learnt that I cannot call set analysis contains variables in onther variable and use the second variable in the chart.
For instance:
If I use the following formula directly in my chart and it works;
sum( {1 <[dimension]={">=$(vVariable1)<=$(vVariable2)"}> } SALES)
If I set the same formula in the variable and call this variable within my chart, the value is empty.. Why?
Thank you for any clues.
Best regards
Do you have an '=' sign at the beginning of the expression when you define the variable ?
Do you have this:
sum( {1 <[dimension]={">=$(vVariable1)<=$(vVariable2)"}> } SALES)
or this:
=sum( {1 <[dimension]={">=$(vVariable1)<=$(vVariable2)"}> } SALES)
If you haven't tried the first, i'd suggest that and invoke the variable with $() expansion ex: $(vVariableName)
What about this:
sum( {1 <[dimension]={">=$(=$(vVariable1))<=$(=$(vVariable2))"}> } SALES)
The right expression is:
sum( {1 <[dimension]={">=$(vVariable1)<=$(vVariable2)"}> } SALES)
without pre equal-sign.
Watch out if you set variables to values that should keep other variables safe from $-sign substitution. If you want to use a variable called vSalesExpression and set it to the expression of your chart, you can do this as-is in the variable overview.
In your script however, you have to make sure that the two embedded variables do survive the assignment, like in:
LET vSalesExpression = 'sum( {1 <[dimension]={">=$' &
'(vVariable1)<=$' &
'(vVariable2)"}> } SALES)';
In any case, make sure that in the end the substituted text contains exactly one equal sign (not two), as Jonathan suggests.