How can I filter on grouped data in Foundry Functions after grouping and aggregating my data? See the code snippet below for reference:
@Function()
public async grouping(lowerBound : Integer ): Promise<TwoDimensionalAggregation<string>> {
let grouping = Objects.search()
.HospitalLosAnalysis()
.groupBy(val => val['primaryHospitalName'].topValues())
.count()
//FILTER SHOULD BE INSERTED HERE
return grouping
}
I want to filter rows where the count is greater than a specified lowerBound
. However, I am struggling to apply a filter as the output of grouping is a TwoDimensionalAggregation
that does not support further filtering.
The goal is to create a chart in Workshop that allows users to focus only on hospitals with a substantial count. Users would input the lowerBound
parameter in a textbox, triggering the function to remove rows with counts less than lowerBound
.