Count records based on expression
Hi i want to display count of records from datasource-table with condition.
For Example: I want to dsiplay count of all records where in table1.column1 city is "usa"
I am not showing any data in data band. I am just creating summary page/statistics page where I need to display only counts and sums based on condition from data-source-table-cloumn.
This discussion has been closed.
Comments
Hi,
Just wanted to join this question. Looking for the answer since I am having trouble grasping the right syntax.
Text:
[Gerät."Status".RecordCount()=="Ausgemustert"]
Current result:
Field not found
I beleave to have found the solution, it lays in the syntax.
For me, this worked:
[SUM(<Gerät."Status"> = 'Ausgemustert',MasterData1,1)]
note used quotation mark!
Oh, I don't know if I'm doing everything right now, but it's not really working for me
Hello!
To count the number of records that meet a condition (for example, City == ‘usa’) for a summary page without printing the table rows themselves:
In the Data window, create a total (Total) called UsaCount:
TotalType = Count
Evaluator = hidden DataBand (linked to your table; you can set its Height to 0 so that the rows do not take up any visual space)
EvaluateCondition = string.Equals(Convert.ToString([Cust.City]), ‘usa’, StringComparison.OrdinalIgnoreCase) (or [Cust.City] == ‘usa’)
Display [UsaCount] in the ReportSummaryBand