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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Architect
Partner - Creator
Partner - Creator

How to use Set Expression instead of 'if' statement.

HI below is the 'IF' statement that I want to replace with 'Set expression'

Please note this expression is used inside the column expression of a Chart.

If(
$(v_Rec_GM)>0 and ([Rec. Sales Price])>= $(vLowcomp), 'G2',
If( $(v_Rec_GM)<=0 and ([Rec. Sales Price])>= $(vLowcomp), 'G1',null)
)

Here I want to replace this IF statement with a Set expression.

@marcus_sommer 

@jwjackso @NitinK7 

Labels (1)
2 Replies
Chanty4u
MVP
MVP

in load script:
If(
$(v_Rec_GM)>0 and ([Rec. Sales Price])>= $(vLowcomp), 'G2',
If( $(v_Rec_GM)<=0 and ([Rec. Sales Price])>= $(vLowcomp), 'G1',null) )AS Flag,

expression with set analysis:

sum({<Flag = {'Yourvalue'}>}Salesprice)

Architect
Partner - Creator
Partner - Creator
Author

@Chanty4u 

we are to change only in set expression. in the load script, we can not do any modification.