Introduction
When working with large datasets, filtering records based on real-time conditions ensures quick access to relevant data. Engyn’s relative filters allow you to define conditions dynamically, so your saved queries always stay updated without manual intervention. In addition to filtering, you can use column stats to apply real-time aggregations such as sum, average, min, and max, providing instant insights into key metrics.
This is particularly useful in scenarios such as:
Booking Management – Automatically displaying upcoming reservations and calculating total revenue without adjusting the date manually.
Sales Tracking – Filtering transactions for the current month while displaying the highest and lowest sale values.
Project Management – Showing tasks due within the next three days along with the average completion time.
Customer Support – Displaying tickets assigned to the logged-in agent while tracking the total number of open cases.
How It Works
By default, saved queries allow users to apply manual filters, which require updating when conditions change (e.g., setting a date range that must be adjusted weekly). With relative filters, queries become dynamic by referencing real-time or current context values like:
Today – Show only records with a date equal to the current day.
Today + X Days – Display future records (e.g., bookings in the next seven days).
Current User – Automatically filter records assigned to the logged-in user.
Without relative filters, users must manually adjust filter values—such as updating the date range for "this week" or selecting a different user in a team-wide report. Relative filters automate this process, ensuring queries always retrieve the most relevant data while column stats provide instant analytics.
Example: Displaying Upcoming Bookings with Aggregated Metrics
Let’s say you want to track bookings scheduled in the next 7 days and display aggregated values for analysis. Without relative filters, you would need to adjust the date filter manually each time.
Open the Query setting by clicking the
icon in the bottom right corner.Step 1: Apply a Relative Filter for Upcoming Bookings
To display only bookings within the next 7 days:
Under the filter section, click + Condition to add a filter.
Select Booking Date as the field.
Choose “Less or Equal” as the comparator.
Click the f(x) button and enter the formula: dateAdd(TODAY(),7,"days"). This ensures only bookings within the next 7 days are shown.
This ensures your saved query always updates dynamically based on the current date.
Step 2: Add Column Stats for Key Metrics
To analyze trends, add aggregations to your query:
Click + Column Stat.
Configure the following:
Column: Select the Booking Amount field.
Label: Enter a custom label (e.g., “Total Booking Value”).
Function: Choose an aggregation (e.g., Sum, Average, Min, Max).
Click Save to finalize the column stat.
Now, your query will not only show upcoming bookings but also summarize key financial data.
Takeaway
Relative filters eliminate the need for manual filter adjustments, ensuring saved queries always return relevant data based on real-time conditions. Column stats provide instant aggregations, helping users analyze data without external calculations. This automation reduces effort, improves accuracy, and enables businesses to make faster decisions. While normal filters require users to update values manually, relative filters and column stats ensure dynamic results, making them ideal for tracking bookings, sales, support tickets, and project deadlines efficiently.