Count Repeatable Values

Stimulsoft Reports.NET discussion
Post Reply
brjohnsmith
Posts: 30
Joined: Mon Jan 29, 2018 11:04 am

Count Repeatable Values

Post by brjohnsmith »

Hi, I need to count the values in a specific databand, but this value can be repeated some times.

Ex:

DataBand1
AAA
AAA
BBB
BBB
BBB

so, in the next DataBand, I need the following result.

AAA = 2
BBB = 3

How can I do it? I tried to use Count, Totals.Count, but noone of them gave me the correct result, the best result was the value 5 for both content.

thx.
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Count Repeatable Values

Post by Max Shamanov »

Hello,

in that case, you can use grouping for the second band and on the GroupFooterBand use the following expression:
{datasourcename.col2} = {Count(Datadatasourcename2)}

Sample report in the attachment.

Thank you.
Attachments
ReportSample.mrt
(17.53 KiB) Downloaded 85 times
brjohnsmith
Posts: 30
Joined: Mon Jan 29, 2018 11:04 am

Re: Count Repeatable Values

Post by brjohnsmith »

Hi Max,
thank you for the info and the answer, but I was not able to open the file after downloading it (if you can attach the screenshot, I would appreciate a lot). See the progress that I had so far.
I used GroupHeader, DataBand and GroupFooter - on this sequence. However, on Footer, the Count is correct, but I have only the last content (based on the example)
the content: AAA, BBB, not belong to the same datasource.
Ex:
BBB = 2
BBB = 3

it is not possible to get the value AAA for the first record, and BBB as the last record. Let me know if it is clear.
thx.
Max Shamanov
Posts: 768
Joined: Tue Sep 07, 2021 10:11 am

Re: Count Repeatable Values

Post by Max Shamanov »

Hello,

I have attached 2 screenshots that show how the values can be calculated.

Thank you.
Attachments
Screenshot_9.png
Screenshot_9.png (12.4 KiB) Viewed 670 times
Screenshot_8.png
Screenshot_8.png (50.66 KiB) Viewed 670 times
Post Reply