Sum of Data Column in DataSource
Sum of Data Column in DataSource
I have a simple datasource (datasource1) that contains two columns. There are two records in this datasource that contain numeric values. My data looks like this
ID VALUE
0 2.5
1 3
I am trying to display the sum of the data in the VALUE field in a text component. My expression is this
{Sum(datasource1.VALUE)}
If i place the text component directly in the report, it only returns the first value in the output (2.5).
If i drop the text component into a databand, the correct value appears (5.5) but is repeated (because the databand renders the value for each record in the datasource). Is there a correct way to accomplish what I am trying to do? It seems like it would be a simple task but it is eluding me currently. Thank you.
ID VALUE
0 2.5
1 3
I am trying to display the sum of the data in the VALUE field in a text component. My expression is this
{Sum(datasource1.VALUE)}
If i place the text component directly in the report, it only returns the first value in the output (2.5).
If i drop the text component into a databand, the correct value appears (5.5) but is repeated (because the databand renders the value for each record in the datasource). Is there a correct way to accomplish what I am trying to do? It seems like it would be a simple task but it is eluding me currently. Thank you.
Re: Sum of Data Column in DataSource
Hello.
The Sum function can't work properly without Data Band.
Please, try to use next expression:
Thank you.
The Sum function can't work properly without Data Band.
Please, try to use next expression:
Code: Select all
{Sum(datasource1, datasource1.VALUE)}
Re: Sum of Data Column in DataSource
Thank you. I received an error when using the datasource name. I created an empty databand, placed the text component outside of the band, and referenced the databand as such.
{Sum(databand1, datasource1.VALUE)}
It now works. Thank you.
{Sum(databand1, datasource1.VALUE)}
It now works. Thank you.
Re: Sum of Data Column in DataSource
Hello.
We are always glad to help you.
Let us know if you need any additional help.
Thank you.
We are always glad to help you.
Let us know if you need any additional help.
Thank you.
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
Re: Sum of Data Column in DataSource
Mine didn't work. I did this:
I created a new calculated column and put this in expression: {Sum(DatadsPackages, dsAwardedContracts.Awarded)}
Need help.
Thanks
I created a new calculated column and put this in expression: {Sum(DatadsPackages, dsAwardedContracts.Awarded)}
Need help.
Thanks
-
- Posts: 6271
- Joined: Tue Mar 20, 2018 5:34 am
Re: Sum of Data Column in DataSource
Hello,
Please send us a sample report with test data that reproduces the issue for analysis.
Thank you.
Please send us a sample report with test data that reproduces the issue for analysis.
Thank you.
- dmasterplan
- Posts: 143
- Joined: Thu Mar 17, 2022 4:04 am
- Location: Philippines
Re: Sum of Data Column in DataSource
Worked now. I just misspelled the variable I assigned it too. Thanks!
-
- Posts: 792
- Joined: Tue Sep 07, 2021 10:11 am
Re: Sum of Data Column in DataSource
Hello,
You are welcome!
You are welcome!