Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join us March 10th, 7 Ways Modern Analytics Can Help You Take Smarter Action. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
José_Espinoza
Partner
Partner

Don't show 0 values in line chart (CY sales, LY sales, Goal sales comparison)

Hi there everyone,

Again here I am with another Qlik related question. This time about line charts. The deal is I'm putting a line chart to compare this year's sales, this year's sales goal and the last year's sales. Sounds like a pretty basic idea, but when I put it together it looks like this.

t97MlHW.jpg

My issue here is that I don't want "Sales CY $" and "Sales Goal $" to drop to zeros, I want them to stop at their current location. Something like this:

pK12V1F.jpg

I already unchecked the zeros option in "Data Handling," but the zeros and the line going down won't disappear. Here are my measures:

-Sales CY: Sum([Sales])

-Sales Goal: Sum( {< date_num={">=$(vDatenumMin_CY)<=$(vDatenumJuneEnd_CY)"}>}  [Sales Goal])

-Sales LY: Sum( {< date_num={">=$(vDatenumMin_LY)  <=$(vDatenumYearEnd_LY)"}>}  [Sales])

I also tried setting a range starting from 0,01, and the zeros disappeared, but the line going down didn't. Any help will be well received and thanks for your time.

1 Solution

Accepted Solutions
sunny_talwar

May be this

-Sales CY: If(Sum(Sales) > 0, Sum([Sales]))

-Sales Goal: If(Sum( {< date_num={">=$(vDatenumMin_CY)<=$(vDatenumJuneEnd_CY)"}>}  [Sales Goal]) > 0, Sum( {< date_num={">=$(vDatenumMin_CY)<=$(vDatenumJuneEnd_CY)"}>}  [Sales Goal]))

View solution in original post

2 Replies
sunny_talwar

May be this

-Sales CY: If(Sum(Sales) > 0, Sum([Sales]))

-Sales Goal: If(Sum( {< date_num={">=$(vDatenumMin_CY)<=$(vDatenumJuneEnd_CY)"}>}  [Sales Goal]) > 0, Sum( {< date_num={">=$(vDatenumMin_CY)<=$(vDatenumJuneEnd_CY)"}>}  [Sales Goal]))

View solution in original post

José_Espinoza
Partner
Partner

Well, I feel really stupid now! Sometimes I think things are more complicated that they seem to be... But thanks a lot! Also, I had to turn that ">" into "<>" because there are some negative values. Again, thanks!