5 Replies Latest reply: Nov 15, 2013 4:24 PM by Clever Anjos

# 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.

Thanks

• ###### Re: Chart displays 0(zero) for null values.

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

• ###### Re: Chart displays 0(zero) for null values.

Hi Clever,

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.

• ###### Re: Chart displays 0(zero) for null values.

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

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

• ###### Re: Chart displays 0(zero) for null values.

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.

• ###### Re: Chart displays 0(zero) for null values.

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

Is it possible to post a sample?