Page 1 of 1

how to get sum of last row in datasource

Posted: Mon Apr 25, 2022 10:58 am
by dmasterplan
I have the datasource that has these values:

PackageCategory Awarded To Let
Consultants 2 1
Contractors 3 0
Suppliers 2 0
Total 7 1
(image attached)

Now, how can I get the sum of values of last row in Stimulsoft? (Total)
7 + 1
lhat would be 8

I want to put in a variable, say, vTotalPackages type Decimal

How do I do it?

Great Thanks!

Re: how to get sum of last row in datasource

Posted: Mon Apr 25, 2022 5:07 pm
by Max Shamanov
Hello,

Please send us a sample report with test data.

Thank you.

Re: how to get sum of last row in datasource

Posted: Mon Apr 25, 2022 11:18 pm
by dmasterplan
But I can't send the database, it's huge!

Re: how to get sum of last row in datasource

Posted: Tue Apr 26, 2022 2:40 am
by dmasterplan
I had it solved already. I just created a datasource counting the records (packages) and assigned it to a variable.

Great Thanks!

Re: how to get sum of last row in datasource

Posted: Tue Apr 26, 2022 8:16 am
by Lech Kulikowski
Hello,

You can use the following expression:
{SumIf(DataBand, DataSourceName.Awared,DataSourceName.PackageCategory == "Total") + SumIf(DataBand, DataSourceName.ToLeft,DataSourceName.PackageCategory == "Total")}

Thank you.