cancel
Showing results for 
Search instead for 
Did you mean: 

Showing Zero if field is null

Former Member
0 Kudos

Hi All,

I have a report having qty fields.I need to show  as zero when value is null.

So wrote a formula like this.

@Target Qty:

if is null(qty) and is null(act qty) then 0 else  qty * act qty.

I placed this is in detail section and working fine.

Then I created a summary  sum(@Target Qty) for this.This also should show as zero when the qty fields are null.

I placed this in report footer .Whenever i kept this in report the @Target Qty which is in detail section is hiding.If i removed summary formula then @Target Qty is showing.

Please suggest what is the problem

Accepted Solutions (1)

Accepted Solutions (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Divya,

So if I understand this correctly, you have a formula (@Target QTY) placed in the Details Section.

You've then inserted a summary on the formula and placed it on the Report Footer. After the summary is paced on the Report Footer, the formula field on the Details Section disappears?

Do you have a conditional suppression logic for the field or the section? Are you sure this is what is happening?

-Abhilash

Former Member
0 Kudos

Hi Abhilash,

yes that's exactly what is happening .

I don't have any suppression logic for detail  section.

Please find the report .here i deleted all the headers as it contains some custom functions

abhilash_kumar
Active Contributor
0 Kudos

Hi Divya,

Thank you for attaching the report.

I tried creating a sample report with a similar formula and for some reason CR does the same thing.

Honestly, I've never seen something like this before. In the end, I could show the summary using a Manual Running Total.

So, modify the @qty formula to:

WhilePrintingRecords;

numbervar summ;

if isnull({ScannedDetails.qty}) and isnull({ScannedDetails.manualqty})

then

0

else

summ := summ + {ScannedDetails.qty}+{ScannedDetails.manualqty};

Create another formula to show the final sum and place this on the Report Footer:

WhilePrintingRecords;

numbervar summ;

-Abhilash

Answers (0)