I am trying to filter a data band based on the number of items in a child band that meet some criterion, and have tried a filter expression like:
CountIf(DataBand, DataSource.Column, DataSource.Column=="ciriterion") > 0
However, I get a message saying that "CountIf" does not exist. Any suggestions as to whether this is possible to do, and if so, what am I doing wrong?
If it is not possible, how could this sort of filtering be achieved?
Using conditional aggregate functions in Filter expression
Using conditional aggregate functions in Filter expression
Hi
Please change the expression as follows:
Totals.Sum(DataBand1,DataSource.Column=="ciriterion"?1:0)>0
Thank you.
Please change the expression as follows:
Totals.Sum(DataBand1,DataSource.Column=="ciriterion"?1:0)>0
Thank you.
Using conditional aggregate functions in Filter expression
Hi Edward,
Thanks for the quick response. Your suggestion sounds reasonable, and it compiles ok, but still doesn't work as a filter - it appears to return 0 even when items meeting the criterion are present. When I put the same expression (minus the "Totals." and the ">0") in a Text box in the databand I am trying to filter, the correct result is shown.
Is there something very different about the environment in which the expression is evaluated in the filter as opposed to a text component?
Thanks for the quick response. Your suggestion sounds reasonable, and it compiles ok, but still doesn't work as a filter - it appears to return 0 even when items meeting the criterion are present. When I put the same expression (minus the "Totals." and the ">0") in a Text box in the databand I am trying to filter, the correct result is shown.
Is there something very different about the environment in which the expression is evaluated in the filter as opposed to a text component?
Using conditional aggregate functions in Filter expression
Hi
Please try to use the following expression instead:
Totals.Sum(DataSource,DataSource.Column=="ciriterion"?1:0)>0
Thank you.
Please try to use the following expression instead:
Totals.Sum(DataSource,DataSource.Column=="ciriterion"?1:0)>0
Thank you.
Using conditional aggregate functions in Filter expression
Hi Edward,
Using the data source instead of the databand in the filter expression gives the total of all records in the data source that meet the criterion regardless of the relation : I need the total of only the records related to each master record in order to filter it.
My real problem is actually more complex - I am trying to filter based on a comparison between the counts using two different criteria, hence I was trying to use CountIf in the sort expression in the master band.
Have you any other suggestions for working around this?
Thanks
Using the data source instead of the databand in the filter expression gives the total of all records in the data source that meet the criterion regardless of the relation : I need the total of only the records related to each master record in order to filter it.
My real problem is actually more complex - I am trying to filter based on a comparison between the counts using two different criteria, hence I was trying to use CountIf in the sort expression in the master band.
Have you any other suggestions for working around this?
Thanks
Using conditional aggregate functions in Filter expression
Hi
Please send your report and data for it to support[at]stimulsoft.com for analysis.
Thank you.
Please send your report and data for it to support[at]stimulsoft.com for analysis.
Thank you.