Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
YAMAMO
Contributor
Contributor

Variable with parameter not evaluated in IF statement

Dear Experts,

I have created a variable as follow :

NS_CML = (sum( aggr(Above( Sum({<Year={$(v_MaxYear),$(v_MaxYearLY)}>} Sales),$1,$2),(RRC,(TEXT,ASCENDING)),(Month,(NUMERIC,ASCENDING)))) )

the variable is working fine inside the pivot table, the values are displayed correctly as follow : $(NS_CML(0,12))

but it is not evaluated inside the IF statement as the following expression :

if($(NS_CML(0,12)) < 0 , 0 , 1 )

could you please help identify why the condition of that variable is not evaluated (when less than zero, it's zero, else it's one).

Labels (2)
3 Replies
sunny_talwar

Are you using the if statement in the same pivot table?

marcus_sommer

Are there any comments within the variable? If yes, remove them.

- Marcus

Brett_Bleess
Former Employee
Former Employee

Have a read through the following Design Blog post, may provide some further things to try:

https://community.qlik.com/t5/Qlik-Design-Blog/QlikView-Quoteology/ba-p/1476029

If one of the other two posts got you what you needed, please be sure to return to your thread and properly close it out by using the Accept as Solution button on the post that helped.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.