cancel
Showing results for 
Search instead for 
Did you mean: 

Pass Dashboard Filter value to Data Model as a Parameter

abhinavt
8 - Cloud Apps
8 - Cloud Apps

Hi Team,

I was wondering if there is way to pass one dashboard filter value ( report id ) to the SQL query in the Data Model.

We have a scenario, when a user loads the dashboard one of the dashboard filters gets dynamically updated while in embedded mode. (We're using EmbedSDK).

I was trying several approaches for Cascading filters without using Dependent Filters feature as we want to have the freedom to control individual filters.

I read about Cascading filters by  @TriAnthony  here (https://community.sisense.com/t5/knowledge/dashboard-script-for-automatic-filter-cascading/ta-p/1899... ). However in our use case, we have different dimensions that wont have same values but we need they need to be cascaded.

Your inputs are greatly appreciated. TIA

1 ACCEPTED SOLUTION

abhinavt
8 - Cloud Apps
8 - Cloud Apps

Hey David,

We found a working solution for this, we were advised to convert all our dashboard filters to background filters. Later we made some changes to the code while embedding such that only the relevant selections from our embed platform are passed to each dashboard filter.

Note :This cannot be done through the frontend dashboard unless we add dependent filters. However, it's great that we found a solution through embedding.

 

View solution in original post

8 REPLIES 8

DRay
Community Team Member
Community Team Member

Hello @abhinavt.

Thank you for your question. Can you provide your use case? I would like to understand why you are trying to pass the filter directly into the query rather than using filters normally.

Can you set a default filter value and even hide the filter from the end user, or use data security to only show the user the data they need?

David Raynor (DRay)

abhinavt
8 - Cloud Apps
8 - Cloud Apps

Thanks for replying David.  

I had this thought while addressing a different problem regarding filters cascading/dependency. Currently this can be only achieved by using dependent filters, but we want to have control over each filter since we disable few of them in some widgets.

We're using a flat view in live connection that holds a request_id (dashboard filter) that is updated every time user runs a new report in embed platform.

If we include a WHERE clause with request_id in the live model then we dont have a problem working with dashboard filters.

Thanks,

Abhinav

DRay
Community Team Member
Community Team Member

Interesting. I suggest opening a ticket with support to see if they have any suggestions, and if not we can schedule some time with a technical resource to work with you.

David Raynor (DRay)

DRay
Community Team Member
Community Team Member

Hi @abhinavt.

Was support able to help you with this? If so, can you share the solution here so others can find it?

Thank you.

David Raynor (DRay)

javiers
7 - Data Storage
7 - Data Storage

Hi @abhinavt,

I'm not sure if I fully understood your use case but here are my 2 cents:

  • You can create dynamic query imports in your data model based on user parameters https://docs.sisense.com/main/SisenseLinux/importing-data-with-custom-queries.htm#DynamicImportQuery
  • You can update the user parameter value for a user with the Sisense API (/user-parameters endpoints)
  • So you can save the request_id per user as a parameter and update it via the API whenever you need it. If you configure the table in the datamodel to be filtered by the parameter,  every time it changes, the table  will be updated.

Wish it helps you!

Hi Javiers,

We have discussed this workaround with the Sisense developer support team. Unfortunately this doesnt fit our use case as users can open multiple tabs with different request ids. But they have suggested a solution to convert filters to background filters and some JAQL changes while embedding. This helped to pass relevant filters for each but background filter.

Although we are working to make sure the background filters stay single select (for our use case) as by default bg filters are multi select  and will update once we found a permanent solution.

DRay
Community Team Member
Community Team Member

Hello @abhinavt.

I wanted to follow up to see if the solution offered by Support or @javiers worked for you.

If so, please click the 'Accept as Solution' button on the appropriate post so other users with the same questions can find the answer. If not, please let us know so that we can continue to help.

Thank you.

David Raynor (DRay)

abhinavt
8 - Cloud Apps
8 - Cloud Apps

Hey David,

We found a working solution for this, we were advised to convert all our dashboard filters to background filters. Later we made some changes to the code while embedding such that only the relevant selections from our embed platform are passed to each dashboard filter.

Note :This cannot be done through the frontend dashboard unless we add dependent filters. However, it's great that we found a solution through embedding.