Page 1 of 1

Sum Column based on value change in other column

Posted: Thu Nov 24, 2016 5:42 pm
by Herbert
Hi all,

I have a Report where I want to sum Column1 when the value in Column2 changes.
How can this be done in Stimulsoft Reports?

Best Regrads
Herbert

Re: Sum Column based on value change in other column

Posted: Fri Nov 25, 2016 10:53 am
by HighAley
Hello, Herbert.

You could use the SumDistinct() function for this.
decimal SumDistinct (object dataSource, object conditionExpression, object sumExpression)

A function returns the sum of all unique values in the specified column or expression.

Parameters
dataSource - The Data Source for processing.
conditionExpression - A condition expression to perform summing on.
sumExpression - An expression to sum up.

Return Value
A decimal number.
Please, look at the attached sample.

Thank you.