Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Replace Sum(Sales) with your expression
=if(Sum(Sales)<0.5, 0, Sum(Sales))
I don't want to use if else but rather set analysis
maybe this:
sum({< Sales= {"=Sales < 0.5"}>} Sales)
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.
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)
Hope it helps