Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Partner
Partner

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
Employee
Employee

Re: Help in set analysis

 

Replace Sum(Sales) with your expression

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

Partner
Partner

Re: Help in set analysis

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

I can walk on water when it freezes
Frank_Hartmann
Honored Contributor II

Re: Help in set analysis

maybe this:

 

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

 

pepecc
New Contributor III

Re: Help in set analysis

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
Contributor III

Re: Help in set analysis

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