Filter data Band using Total Functions

Stimulsoft Reports.NET discussion
paul.thomas
Posts: 18
Joined: Mon Jun 06, 2022 5:39 am

Filter data Band using Total Functions

Post by paul.thomas »

Hi ,
i am using desktop designer to design templates. consider I have a dataSource that uses SQL query to get the table from a PostgreSQL server of the column Name, organization and cash. I just want to show/filter the person with max cash in an organization on the data band. How is this logic Applied ? . I have used a groupby band using the organization column as the condition for grouping

i used to put Max(DataSource.cash)==DataSource.cash as expression inside the data band filter which used to work till 2022.2.5

after upgrading it to 2022.3.5 Max(DataSource.cash) returns only 0
Last edited by paul.thomas on Wed Sep 14, 2022 4:53 pm, edited 1 time in total.
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Filter data Band using Total Functions

Post by Lech Kulikowski »

Hello,

We couldn't reproduce the issue on our samples.

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
paul.thomas
Posts: 18
Joined: Mon Jun 06, 2022 5:39 am

Re: Filter data Band using Total Functions

Post by paul.thomas »

i have attached a report template in this comment. Please try to output the row with max cash
Attachments
ExampleReportTemplate.mrt
(11.78 KiB) Downloaded 74 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Filter data Band using Total Functions

Post by Lech Kulikowski »

Hello,

Please send us csv file also.

Thank you.
paul.thomas
Posts: 18
Joined: Mon Jun 06, 2022 5:39 am

Re: Filter data Band using Total Functions

Post by paul.thomas »

please try this via desktop designer . i have attached the csv
Attachments
myFile0.csv
(15.73 KiB) Downloaded 74 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Filter data Band using Total Functions

Post by Lech Kulikowski »

Hello,

Your report is not working not in 2022.2.5, not in the 2022.3.5 version. Please use the following expression:
Totals.Max(ExampleData, ExampleData.filter)==ExampleData.filter

Thank you.
paul.thomas
Posts: 18
Joined: Mon Jun 06, 2022 5:39 am

Re: Filter data Band using Total Functions

Post by paul.thomas »

i dont know why the report is not working in 2022.3.5 version as i have used that version of desktop designer to design it .

the code given above works but i think it returns the maximum of filter compared to entire data set. Its my mistake for providing such a data set. i shall attach new csv file where it has name cash and organization

please provide expression for maximum cash held by someone in a particular organization. Sorry for the inconvenience
Capture.PNG
Capture.PNG (173.74 KiB) Viewed 875 times
Attachments
Name-money-organisation.csv
(27 KiB) Downloaded 78 times
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Filter data Band using Total Functions

Post by Lech Kulikowski »

Hello,

The same result. You should use the following expression:
Totals.Max(ExampleData, ExampleData.Cash)==ExampleData.Cash

Thank you.
paul.thomas
Posts: 18
Joined: Mon Jun 06, 2022 5:39 am

Re: Filter data Band using Total Functions

Post by paul.thomas »

Hi,

Sorry i was late to reply on this. but this expression looks for largest cash in the entire datasource then filters only them out. i wanted largest per department. not largest cash in the entire data source. The online designer works as intended when i use Max(exampleData.cash) ==exampleData.cash why isnt the same done here as well

thank you
Lech Kulikowski
Posts: 6238
Joined: Tue Mar 20, 2018 5:34 am

Re: Filter data Band using Total Functions

Post by Lech Kulikowski »

Hello,

> The online designer works

What do you mean about the online designer?

Thank you.
Post Reply