Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

José_Espinoza
New Contributor II

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
MVP
MVP

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

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]))

2 Replies
MVP
MVP

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

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]))

José_Espinoza
New Contributor II

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

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!

Community Browser