Totals with condition
Often you need to calculate totals with condition.. For example, you want to sum up all values higher than zero. StimulReport.Net allows to add a condition to an aggregate function. When you add a condition to an aggregate function you should add If to this aggregate function name and additional argument with condition. For example:
{SumIf(Products.UnitsInStock, Products.UnitsInStock > )}
- this expression will return the sum of elements but every element is to be higher than zero. For the Count function:
{CountIf(Products.UnitsInStock == 0)}
- this expression will return the sum of elements equal in zero. If you want to make calculations using the Double or the Int64 types then, at first, you should add Latin D or I and then If to the aggregate function name. For example:
{SumDIf(Products.UnitsInStock, Products.UnitsInStock > 0)}