Skip to main content
Announcements
WEBINAR April 23, 2025: Iceberg Ahead: The Future of Open Lakehouses - REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
bc123456
Contributor

Filter Negative Values before Aggregation

Hi - Below is a sample data set along with what I am getting vs. what I want. How can I filter the negative values out before the sum aggregation? The problem is Value is an expression. Let's say it's Value1-Value2= Value

bc123456_0-1673893413471.png

 

Thanks for your help!

 

Labels (4)
2 Replies
pedrobergo
Employee

Hi @bc123456 

You can use Set Analysis:

Sum({<Value={">0"}>}Value)

Or just using If

Sum( if(Value>0,Value,0))

[],

Pedro

MarcoWedel

another option might be:

Sum(RangeMax(Value,0))