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: 
Not applicable

Minimum of values not zero

This is probably really easy but I cannot find the function for it. Basically I want to take the minum of all values in my dimension which is not zero.

i.e for the following dataset:

id, value, ....

1, 4800,

2, 3300,

3, 2900,

4, 3000,

5, 0,

6, 4100,

7, 2400

8, 0

9, 2800

I want the expresion to return 2400. This is only for one visualization so I don't want to remove the 0 values in the data load script. I was looking for a "filter" function to filter out all 0 values in the array before applying the Min aggregation but it doesn't seem to exist.

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

min({<value={">0"}>}value) should work

View solution in original post

5 Replies
antoniotiman
Master III
Master III

Hi Viktor,

You can use Calculated Dimension like

Aggr(If(Sum(Value) > 0,ID),ID)

Regards,

Antonio

Clever_Anjos
Employee
Employee

min({<value={">0"}>}value) should work

Not applicable
Author

I hadn't come across the set concept yet. This is what I was looking for, thanks.

Not applicable
Author

Thanks for the answer! It takes a little bit getting used to the Qlik script syntax and function names. I'm a bit confused about Aggr. I'm used to thinking functional and was looking for "filter" or "map" functionality. I first thought Aggr is map but looking at the examples is more like SQL group by?

antoniotiman
Master III
Master III

Yes Viktor,

Aggr() is Group By.

Aggr(If)) is Group By + where

Regards,

Antonio