Re: {Sum(value) + (value)} Not Working

Stimulsoft Reports.JS discussion
Post Reply
ericp
Posts: 41
Joined: Mon Aug 21, 2023 9:22 pm

Re: {Sum(value) + (value)} Not Working

Post by ericp »

I am able to see the 2 values that I'm trying to add by using the Expression: {Projects_ProjectRevisions_ProjectRevisionFunding.PE} + {Projects_ProjectRevisions_ProjectRevisionFunding.ROW} and that shows me like 10 + 10 on the preview, but when I try to add these together to try to get the sum of 20 using {Sum(Projects_ProjectRevisions_ProjectRevisionFunding.PE) + (Projects_ProjectRevisions_ProjectRevisionFunding.ROW)}.

Please refer to the screenshot below. They are both the same databand, just copy and pasted to show the example. The first box clearly shows that it recognizes both values that need to be added, but when I use the {Sum} function, those numbers do not add up.

FYI. I even tried another simple test scenario and it wasn't working - I uploaded a JSON that simply has
"FiscalYearStart": "2020",
"FiscalYearEnd": "2024"

And designer recognizes both of these 2020 and 2024 values, but when I try to do {FiscalYearStart + FiscalYearEnd} or {Sum(FiscalYearStart + FiscalYearEnd)} or {Sum(FiscalYearStart, FiscalYearEnd)} all of these aren't summing the numbers together, they just put the numbers together. So instead of 2020+2024=4044, which is the value I want. It's just giving me 20202024
Attachments
Screen Shot 2023-10-14 at 10.29.18 PM.png
Screen Shot 2023-10-14 at 10.29.18 PM.png (404.82 KiB) Viewed 8222 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Re: {Sum(value) + (value)} Not Working

Post by Lech Kulikowski »

Hello,

>> And designer recognizes both of these 2020 and 2024 values, but when I try to do {FiscalYearStart + FiscalYearEnd} or {Sum(FiscalYearStart + FiscalYearEnd)} or {Sum(FiscalYearStart, FiscalYearEnd)} all of these aren't summing the numbers together, they just put the numbers together. So instead of 2020+2024=4044, which is the value I want. It's just giving me 20202024

Yes, that is the correct result. Your columns are string.

Thank you.
Attachments
Screenshot 2023-10-16 213702.png
Screenshot 2023-10-16 213702.png (144.97 KiB) Viewed 8168 times
ericp
Posts: 41
Joined: Mon Aug 21, 2023 9:22 pm

Re: Re: {Sum(value) + (value)} Not Working

Post by ericp »

Hey Lech, another question I had was in terms of 'Processing Duplicates' I have a lot of Projects in my JSON, and each one has the 'FiscalYear' object, I only want to see these Fiscal Years once and not have it repeat for every project. I've tried playing around with the Duplicate feature, but it doesn't seem to collapse them
Attachments
Screen Shot 2023-10-16 at 2.34.02 PM.png
Screen Shot 2023-10-16 at 2.34.02 PM.png (339.88 KiB) Viewed 8164 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Re: {Sum(value) + (value)} Not Working

Post by Lech Kulikowski »

Hello,

Please send us your report with test data for analysis.

Thank you.
ericp
Posts: 41
Joined: Mon Aug 21, 2023 9:22 pm

Re: Re: {Sum(value) + (value)} Not Working

Post by ericp »

Hi, please see the file below:

I've created a panel where I've been playing around with the data. Thank you!
Attachments
TestSample.mrt
(48.35 KiB) Downloaded 59 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Re: {Sum(value) + (value)} Not Working

Post by Lech Kulikowski »

Hello,

Please send us test data for your report.

Thank you.
Post Reply