How to use multiple filters on aggregated results?
Hello,
I have a database table of airline tickets. On my front end the user can filter the airline tickets by:
- airline
- destination country
- destination city
- client name
- traveler name
- cabin
The user can filter by one of these elements (e.g. airline), or by multiple elements (e.g. airline + destination city + cabin).
So in my endpoint I have these inputs:
The endpoint should return the airline tickets grouped by client_name + aggregated by selling_price (sum). But the result should be filtered by the value of one or more inputs.
I know how to group and aggregate results within a "Query All Records" function, but I can't figure out how to add the filters dynamically, depending on if the input value != ""
I have already tried to use Lambda functions to filter the results, but then I can't group and aggregate the results after the Lambda function anymore…
Does someone have any advice on how to dynamically filter a "Query All Records" results depending on whether one or more inputs has a value?
Thank you!
Best Answer
-
hi @sampannemans using the ignore empty values check within the query all records expression builder will tell the query to ignore that expression if there is no input value provided:
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback