Have you ever felt like your dashboard was static, and all it needed was a little bit of spontaneity and controlled chaos to make it more fun? Templated filters do just that! In Omni Analytics, templated filters are as dynamic as they get.
Dynamicity is fundamental, trending, and critical in any modern dashboard. But why? It’s because you no longer have to ask what if? and can start seeing what is. Let’s say you can see the sales trend across departments, and now you’re wondering, “What if we want to see the sales trend across one department in the year 2025?”. With templated filters, you no longer have to worry about that. With the help of a single click, you can now view and visualize “what is the sales trend across one department in the year 2025”.
In this blog, we’ll look into why templated filters are important, how to create templated filters in Omni Analytics, and give you a few tips to improve your learning. Let’s get started.
What is Omni Analytics?
Omni is a direct-query BI platform designed for fast, self-service analytics. It combines the flexibility of a spreadsheet-like experience with the power of advanced business intelligence.
Why Choose Omni?
Easy for Everyone – A simple, intuitive interface makes data analysis accessible, even for non-technical users. It translates complex database schemas into a business-friendly data model, so users can ask questions in plain language.
Self Service Analytics – Build reports and dashboards without coding, just like working in a familiar spreadsheet by writing Excel formulas. This empowers business users to get their own answers quickly, reducing bottlenecks and accelerating decision-making.
Seamless Data Connections – Connect to multiple sources effortlessly with built-in integrations. Omni natively integrates with modern cloud data warehouses like Snowflake and dbt, ensuring a single source of truth for your entire data stack. The semantic layer in Omni, acts as a single source of truth for all dashboards across the company. By defining metrics and business logic in one place, it ensures everyone works from the same consistent numbers, building trust and enabling more reliable data-driven decisions.
What are Templated Filters in Omni?
If you’re not new to data analytics, it helps to consider Templated Filters as analogous to parameters. But for those unfamiliar with this, a templated filter is a reusable, pre-built control on a dashboard that lets you quickly change the data you see without manually editing the report. Consider it like a remote control to your dashboard, where you can see the data from a different perspective with a single click.
You must be wondering how they are different from regular filters.
A regular filter is for ad hoc, front-end filtering, while a templated filter is a backend, reusable component of the semantic model. Regular filters are the standard, point-and-click filters that serve the purpose of a more exploratory, on-the-fly analysis.
Templated filters are a more advanced feature. They are defined in the YAML files of the Omni semantic model. They alter the underlying SQL query and generate the results on the dashboard, making them more dynamic and reusable.
In Omni, while regular filters and controls already cover most of the basic functionalities, such as filtering out the data and ad-hoc swapping of dimensions, templated filters are the perfect way to build very creative, complex, and out-of-the-box filters.
What are the Benefits of Using Templated Filters in Omni Analytics?
Templated filters in Omni Analytics provide us with various benefits.
Increased Reporting Speed: Regular filters help us filter out data on specific dimensions. Templated filters, on the other hand, help us combine multiple filters into a single one. This reduces the total number of filters and thus increases the reporting speed.
Maintaining Consistency: As we know, Omni emphasizes the semantic model approach. This ensures that everyone in the organization works with the same data definitions and filters, leading to a single source of truth. No matter who uses the data and filters, it will always point to the correct data and logic.
Scalable Filter Management for Teams: Templated filters are defined in the semantic model’s YAML file, so they are part of a Git-backed workflow. If a filter’s definition needs to be updated, the team can make a change in the YAML file, and this update is then automatically applied to every report and dashboard that uses that filter.
Enhanced User Experience: Templated filters offer a much simpler approach to complex filtering. With a single click, users can avoid navigating through multiple nested filters. This empowers non-technical users with more creative freedom to ask and answer their own questions, building user confidence and driving wider data adoption.
Next, let’s visualize those benefits for the reader by looking into 3-5 use cases, ideally some you’ve worked on for clients. Call out situations where Templated Filters make sense and what benefits businesses can achieve.
How to Set Up Templated Filters in Omni Analytics
Let’s consider the following scenario where we have only the employee ID, employee name, and reports to fields in our dataset.
To understand this more easily, let’s create a hierarchy chart.
Suppose the business user wants to view the report for Laura Callahan’s team alone, i.e., the employees and Laura Callahan. Here, we can’t use a direct filter on reports to as it would not include Laura Callahan. Templated filters provide us with an easy solution for such a tricky situation. Let’s get started on how to build a templated filter for this.
Step 1
We need to get to the Workbook model of this data.
Go to the Model > Model layers > Workbook.
This should open the workbook model layer in a new tab. To verify that you’re on the workbook model layer, check if you can see this at the top left of the page.
Step 2
Navigate to the required view under Schemas in the left sidebar menu.
The fields I require come under the OMNI_NORTHWIND_TRADERS schema and the Employees table. In the model, tables are often known as views.
You should be able to see the view definition now.
Step 3
Let’s modify the YAML definition so that we can view our filter in the table.
Scroll down until you reach the end of the measures definition.
Let’s add a filter section after the measures section to add a filter to our table.
filters:
:
type:
suggestion_list:
- value:
Repeat the value and label for as many filter options as you need.
<filter_type> would be the values you have in the options. The filter would be on employee names, so the filter type here would be string.
Since we need to filter on the superiors (the people who have reportees under them), our options will include anyone who has someone under them in the hierarchy.
Let’s name it empflag.
Step 4
This filter allows us to filter out the data based on the filter value. We would accomplish this by writing a simple SQL CASE WHEN statement.
Navigate to the dimensions definition.
Under dimensions, we added another field to help us filter.
:
sql: CASE WHEN
{{filters.__..value}}='
Ideally, we require as many conditions as the number of options we have.
In our case, we built this filter condition such that the reports to field and employee ID field match the superiors’ IDs. This includes the reportees as well as the superior.
If you want to provide the user with a filter with only one select, you can add this label after the flag.
filter_single_select_only: true
Click the Save changes button in the top right corner to save all your changes.
Step 5
Let’s now add this to our sheet and see if it works.
Return to the Sheet tab. Refresh it, and you should see the two new fields you have added to the employee view.
After adding Sales to the view, this is the current version.
We add both of these fields to the sheet as filters like this.
You should be able to see both the filters on the top.
Set the flag value to true. All the data should disappear and show no results.
We set a filter for one of the filter conditions to match. Since we do not have an ELSE statement in the SQL query and have not selected a value in Empflag, we do not see any results.
Now we can select values in Empflag, which will give us the required results.
To implement this on the dashboard, we can add the flag filter on the sheet and set it to true.
Then we can add the Empflag filter on the dashboard.
Hope this was easy to understand and follow!
Best Practices
Some of the best practices we recommend following are:
- Use meaningful names to define your filters and the SQL condition fields. With large models, this helps you keep track of the filters and their associated filter conditions.
- After defining the filters and the conditions, place comments that might help other users understand the code.
- Follow proper alignment on the YAML files for better readability.
Closing
Now that you’ve got templated filters up and running, it’s a great time to dig into everything Omni Analytics can do. Whether you want to experiment with dynamic what-if scenarios or play around with markdown-powered titles, the possibilities open here.
Let’s see what we can build together!
If you ever get stuck or want a second set of eyes on your next project, contact us at phData. We’re always happy to chat, brainstorm, or lend a hand so you can keep driving value with your data.
FAQs
What is the difference between the Workbook and the Shared model in Omni Analytics?
The Workbook model in Omni is a personal space for ad-hoc analysis and prototyping, where you can quickly explore data without affecting others. The Shared model, on the other hand, is the governed, centralized, and reusable foundation of your data definitions. It ensures everyone in the organization works from a single source of truth, promoting consistency and trust.




