Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Our May 2021 end-to-end product release from Data Integration to Data Analytics is out! READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
Architect
Creator
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
Champion III
Champion III

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
Creator
Creator
Author

@Chanty4u 

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