Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

Non Zero Expression

HI All,

I need a suggestion in framing a expression which should also pick a non zero max value if both zero and non values exist for a selection,

Incase if only one value exist (zero or non zero ) it should show that value

Sample data:

kunkumnaveen_0-1647926367169.png

If I select date 20220414 the max value is 0 but it also got non zero values hence it should show max non zero value in a KPI

kunkumnaveen_1-1647926559194.png

 

it should show the highlighted value instead of zero value 

Can any suggestion plz in writing the expression 

 

Labels (1)
1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Try

If(Count(distinct Difference)=1,Only(Difference),Max({<Difference-={0.000}>} Difference))

View solution in original post

3 Replies
hic
Former Employee
Former Employee

Try

Max({<Difference-={0.000}>} Difference)

kunkumnaveen
Specialist
Specialist
Author

Hi Henric,

Thank You for your reply , the above  expression picks non zero max value when there is zero and Non zero values exist for a selection 

The expression should also show up zero values too if there is only one value 

For example :

kunkumnaveen_0-1647939781911.png

 

 

if I select a date which has only zero value it is showing null in KPI

kunkumnaveen_1-1647939846704.png

 

 

hic
Former Employee
Former Employee

Try

If(Count(distinct Difference)=1,Only(Difference),Max({<Difference-={0.000}>} Difference))