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

Protect agains Dividing by 0

I have an expression in a graph,

sum({<Date*={">=$(StartDate) <=$(EndDate)"}>} MetricOne)

/

sum({<Date*={">=$(StartDate) <=$(EndDate)"}>} MetricTwo)



This is supposed to divide metricone by Metric two. If MetricTwo is 0 I want the expression to just be 0. How can I do this?

Thanks!

1 Reply
boorgura
Specialist
Specialist

cant you just use if(Metric2 = 0, 0, Metric1/Metric2) ?

That should be a straight one. Not sure if you are constrained by something else.