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: 
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.