Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ali_hijazi
Partner - Master II
Partner - Master II

Help in set analysis

Hello

got an expression that returns numbers 
these numbers if they are <0.5 then I need to display zeros

is there a way to make a check other than if else statement?

I can walk on water when it freezes
5 Replies
Lisa_P
Employee
Employee

 

Replace Sum(Sales) with your expression

=if(Sum(Sales)<0.5, 0, Sum(Sales))

ali_hijazi
Partner - Master II
Partner - Master II
Author

I don't want to use if else but rather set analysis

I can walk on water when it freezes
Frank_Hartmann
Master II
Master II

maybe this:

 

sum({< Sales= {"=Sales < 0.5"}>} Sales)

 

pepecc
Contributor III
Contributor III

I think he wants to exclude the final results of the sum function that are less or equal than 0.5, not each part of it.

kaanerisen
Creator III
Creator III

Hi ali_hijazi,

First of all, set analysis is not used for changing data, it is used for reducing or filtering data set. You shoud use if else statement and combine with aggr function ( eg. sum(aggr((if else statement),DIM)) )

aggr(without IF ELSE)

sum(aggr(Sum({<DIM={"=SUM(VALUE)<0.5"}>}VALUE),DIM))

But if you don't want to use IF ELSE statement, I can suggest you an alternative way.

 

SampleData:
load
*
Inline [
DIM,VALUE
A,0.4
B,0.8
C,1.3
D,0.2
E,1.4
F,1.3
];

 

Expression:

 

SUM(VALUE)-Sum({<DIM={"=SUM(VALUE)>=0.5"}>}VALUE)

 

 

Untitled.png

Hope it helps