Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dandaanilreddy
Partner - Creator III
Partner - Creator III

Variable not working in expression

Hello All,

I am facing issue with a variable in my expression. Even if i hard code the value for the scenario my expression is not working. When ever i comment the scenario part the expression is working fine. . I want to compare 2 scenarios based on the selections. Scenario 1 and scenario 2. For this i have added the 2 scenario variables as dimensions and the below expression. Please can someone look into this?

num(Sum(if(right(IAC,2)='A1',
if(Scenario={'$(vScenario1)'},
if(right(business,5)='Ratio',value*100,
value))))/Unit_Value,'$(vDecimal)')

 

Thanks

 

 

1 Reply
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

'{}' is not required in if statement.

Try:

num(Sum(if(right(IAC,2)='A1',
if(Scenario=$(vScenario1),
if(right(business,5)='Ratio',value*100,
value))))/Unit_Value,'$(vDecimal)')

Check also if your variable has '=' at the beginning .