Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I think this is a syntax issue???

Hi all,

I have some code which works:

[code]

if([Cancel Agreement Indicator]='N' and [Report Date]=[AGRDIMS.Agreement Activation Date] and vCriteria_AmtOperator<>'ALL' and vCriteria_MgnOperator='ALL',

sum(if([AGRDIMS.Current Net Cash Advanced] > $(vCriteria_Amt),1,0)),

if([Cancel Agreement Indicator]='N' and [Report Date]=[AGRDIMS.Agreement Activation Date] and vCriteria_AmtOperator='ALL' and vCriteria_MgnOperator<>'ALL',

sum(if([AGRDIMS.Current Net Cash Advanced] > $(vCriteria_Amt),5,0)),

if([Cancel Agreement Indicator]='N' and [Report Date]=[AGRDIMS.Agreement Activation Date] and vCriteria_AmtOperator<>'ALL' and vCriteria_MgnOperator<>'ALL',

sum(if([AGRDIMS.Current Net Cash Advanced] > $(vCriteria_Amt),10,0))

)))

[/code]

However in the section:

[AGRDIMS.Current Net Cash Advanced] > $(vCriteria_Amt)

I want to replace the angle bracket '>' with a variable where the user has selected an operator, however when I drop in the variable my expression stops working:

[AGRDIMS.Current Net Cash Advanced] $(vCriteria_AmtOperator) $(vCriteria_Amt)

Any idea's would be much appreciated.

Many thanks,

Phil

3 Replies
jedgson
Creator
Creator

You can create a new variable to hold your entire expression.  Something allong the lines of:

vExp

='If( [Value2] ' & $(vCriteria_AmtOperator) & ' [Value2], 10, 0)'

You can then add this variable to the expression of a chart like

=$(vExp)

Jay

Not applicable
Author

Thanks Jay, that sounds a neat solution let me give it a try and I'll let you know how I get on.

Kind Regards,

Phil

jedgson
Creator
Creator

Phil,

I need to amend my syntax above.  It should have been:

='If( [Value2] ' & vCriteria_AmtOperator & ' [Value2], 10, 0)'

i.e the $() should not be around the variable name in the 1st part.

Jay