I am very new to sisense I am trying to figure out a way to apply a filter to one specific widget in the dashboard. (I have successfully managed to apply a filter to the whole dashboard)
Use Case:- I have a dashboard with 4 widgets displaying 4 simple tables.
1st widget - Shows user logins ("user_logins" table has a column "login_date")
2nd widget - Shows user downloads ("user_downloads" table has a column "downloaded_date")
3rd widget - Shows user certifications ("certifications" table has a column "passed_date")
4th widget - Shows user exams ("exams" table has a column "exam_date)
As you can see dates are displayed from different tables and columns. I know how to filter the whole dashboard using "user_id" as all the tables have the column "user_id".
What I am trying to achieve is when I input a daterange from a daterange picker, I want sisense to filter each widget using their respective table column. How can I achieve that?
I have tried the code below.
window.filters['{{ name }}{{ index }}_from'] = {
disabled: false,
jaql: {
title: "{{ subFilter.column }}",
table: "{{ subFilter.table }}",
columm: "{{ subFilter.column }}",
dim: "[{{ subFilter.table }}.{{ subFilter.column }}]",
datatype: "datetime",
level: "days",
filter: {
from: 0
}
}
};
dash.$$model.filters.update(window.filters['{{ name }}{{ index }}_from'], { refresh: false, save: true });
window.filters['{{ name }}{{ index }}_to'] = {
disabled: false,
jaql: {
title: "{{ subFilter.column }}",
table: "{{ subFilter.table }}",
columm: "{{ subFilter.column }}",
dim: "[{{ subFilter.table }}.{{ subFilter.column }}]",
datatype: "datetime",
level: "days",
filter: {
to: 0
}
}
};
dash.$$model.filters.update(window.filters['{{ name }}{{ index }}_to'], { refresh: false, save: true });
This code does not throw any errors but does not generate any result as well.
Does anyone have any idea how to fix this?