Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis: divide by zero

Hi all,

How can I do because VAR% in the attached example the column on the line agent A4 appears "-100.00"

This agent A4 not have  sales in year 2015 and so the VAR column can not do with a division by 0.

(1 - sum (Year2014) / sum (Year2015)) * 100

For the line A4 is sum (Year2015) = 0

thank All

Labels (1)
2 Replies
sunny_talwar
MVP
MVP

Try this:

Alt((1 - (Sum ({<Year={"$(=(max(Year)-1))"}>} Sales) /

   Sum ({<Year={"$(=(max(Year)-0))"}>} Sales))  ) * 100, -100)


Capture.PNG

swuehl
Champion III
Champion III

Try

(1 - alt((Sum ({<Year={"$(=(max(Year)-1))"}>} Sales) /

   Sum ({<Year={"$(=(max(Year)-0))"}>} Sales))  ,2)) * 100