Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart displays 0(zero) for null values.

Hello All,

I have a line chart with 2 expression, one displays YTD fiscal year data and other displays entire last fiscal year's data.

For current year values for future month in DB are nulls but in Chart object sum({<YTD calculation>}DataField) displays zero instead of nulls for future months.

I also need to display average trend for current year, since 0 is a values my average is skewed as the denominator is always 12.

Please Advice.

Thanks

5 Replies
Clever_Anjos
Employee
Employee

Try this, because a sum of an empty set will return 0, not null, so you can test it and return null as needed

if(sum({<YTD calculation>}DataField)<>0,sum({<YTD calculation>}DataField) )

Not applicable
Author

Hi Clever,

Thank you for your reply.

The chart is displayed of fiscal months, and issue here is that data could be genuinely zero values in between YTD range.

E.g:

Aug   20

Sep   15

Oct    0

Nov   10

Dec   -

my straight table should give me following representation.

Thank you.

Clever_Anjos
Employee
Employee

Try counting and checking if there´s some data for that period

if(count({<YTD calculation>}DataField)<>0,sum({<YTD calculation>}DataField) )

Not applicable
Author

Hi Clever,

Thanks for the response once again.

I tried that,but if will treat 0 values for months in YTD range also as nulls and we need to show them as ) but 0 values after the last month in YTD range only should be treated as nulls.

In other words if sum(DataField) = 0 then keep 0 else if sum(blank cell) gives you 0 then convert that to null.

Thanks.

Clever_Anjos
Employee
Employee

I´m not following you, what do you mean by 'blank cell'?

Is it possible to post a sample?