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: 
kunkumnaveen
Specialist
Specialist

Who to write expression in optimize way

Hello All,

I have written a expression with plenty of IF conditions in it and  it is doing the purpose,   but when I look it I personal feel that it can be written in more optimize way 

Kindly suggest me how can I write the below expression in more optimize way instead of IF conditions 

 

if(SubStringCount([Measure for Filter],'ABSRPT'),
if('$(vComparison)'='8', sum([Impact]),
if(vComparison=1,
if(Num(sum([ABSRPT]), '#,##0.##', '.' , ',' )=Num($(vThresholdValue), '#,##0.##', '.' , ',' ),sum([Impact])),

if(vComparison=2,
if(sum([ABSRPT])<>$(vThresholdValue),sum([Impact])),

if(vComparison=3,
if(sum([ABSRPT])>$(vThresholdValue),sum([Impact])),

if(vComparison=4,
if(sum([ABSRPT])>=$(vThresholdValue),sum([Impact])),

if(vComparison=5,
if(sum([ABSRPT])<$(vThresholdValue),sum([Impact])),

if(vComparison=6,
if(sum([ABSRPT])<=$(vThresholdValue),sum([Impact]))

)))))))

 

Note: Copying only a piece of lines from my 143 line expression hoping that if i fix this i can fix the rest tooo

 

Thanks

 

 

 

Labels (1)
1 Reply
kunkumnaveen
Specialist
Specialist
Author

Any suggestion Plz how can I write the above expression in a optimize way I mean with less IF conditions