Jinja Template for dynamic conditions #30990
Replies: 1 comment 8 replies
-
Hey @Keveen-ghori! 👋 I'm here to help you with any bugs, questions, or contributions you have. Let's squash those bugs together! To achieve dynamic filtering in a single dataset using Jinja templates, you can leverage the Jinja templating capabilities in Apache Superset. This allows you to create a flexible dataset that can adapt to different conditions, such as meter types, without needing to create separate datasets for each type. Here's how you can implement this:
Regarding the best practice of using multiple datasets versus a single dataset, it generally depends on your specific use case and performance considerations. Using a single dataset with dynamic filtering can simplify maintenance and reduce redundancy, but it may have performance implications if the dataset is large and complex. It's important to test and monitor performance to ensure it meets your needs [1][2]. |
Beta Was this translation helpful? Give feedback.
-
I want to use jinja template and want to dynamically apply parameters in query and want to save query as dataset.
Let me explain complete scenario:
I have MV that contains all data of different meter type, but I want to dashboard that contains different tabs with different meter types. So, I am creating a dataset for that dashboard, but for each meter types i have to create datasets. Is there any way to use single dataset that dynamically add WHERE condition in each tabs?
Here is the query that i am currently trying:
Help me to find solution related to this case that i am thinking to implement.
If there is any alternative then also please suggest.
Here, I want to ask is it best practice to use more dataset in a dashboard? or it is good to use one dataset in entire dashboard.
Beta Was this translation helpful? Give feedback.
All reactions