Totals: CountIf – ignoring null val

Stimulsoft Reports.Silverlight discussion
Locked
StepTK
Posts: 30
Joined: Fri Oct 25, 2013 10:22 am

Totals: CountIf – ignoring null val

Post by StepTK »

Hello,

if we count the number of used values of a column in a DataBand, we want the cells that contain no value (null) does not count.

The formula
{CountIf (Data, SampleData.Al2O3 > 0)}
works, but 0 can also be an allowable value.

The ideal would be the formula with the condition "<> Null"
{CountIf (Data, SampleData.Al2O3 <> Null)}
but so returns no result.

Is there a solution?

Thanks!

Stephan
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Totals: CountIf – ignoring null val

Post by Alex K. »

Hello,

Please try to use the following expression:
{CountIf (Data, SampleData["Al2O3"] <> DBNull.Value)}

Thank you.
StepTK
Posts: 30
Joined: Fri Oct 25, 2013 10:22 am

Re: Totals: CountIf – ignoring null val

Post by StepTK »

Thank you, this works depending on C#/VB using != or <>

Stephan
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Totals: CountIf – ignoring null val

Post by HighAley »

Hello, Stephan.

Yes, the expression depends on using language.

Thank you.
Locked