Crystal Reports
In Crystal Reports you can easily create a Running Total based on a numeric field. We'll give a simple example.
In Crystal Reports you can easily create a Running Total based on a numeric field. We'll give a simple example.
- right click the numeric field.
- choose Insert.
- click Running Total.
We'll get:
- We could now simply click OK, and our Running Total is there.
- We can also click Use a formula under Evaluate.
- Click the X+2 button.
- Then fill in the formula:
{Order Details.Quantity}>100
Now we would have a conditional Running Total, only totaling the values over 100.
SS Reporting Services / Report Builder
We'll now try the same example in Report Builder.
- To our table we have to add a column.
- Right-click this column.
- Click Expression.
We'll get:
- There fill in the formula:
=RunningValue(Fields!Quantity.Value,SUM,"dstOrder")
- Clicking OK would give us a column with a Running Total.
We still need to add the condition. Now the formula becomes a little more difficult:
=RunningValue(iif(Fields!Quantity.Value>100,Fields!Quantity.Value,
nothing) ,SUM,"dstOrder")
But in the end the result would be the same: a conditional Running Total, only totaling the values over 100
Reacties