Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Field YEAR has values from 1990 to 2050
Need to create a filter pane having values 2019,2020,2021.
Chart should should show by default 2020 data and user is allowed to select only 1 value at a time (i.e. either 2019,2020 or 2021).
Below is the expression
Count( DISTINCT id)
Create a filter pan with below expression
=aggr(only({<Year = {">=$(=year(today())-1)<=$(=year(today())+1)"}>}Year),Year)
then create a variable vYear at front end with below expression
=if(GetSelectedCount(Year)=0,year(today()),max(Year))
then you can use below expression in your chart to restrict it default to current year ..based on filter selection it will change.
Count( DISTINCT {$<Year={"$(vYear)"}>}id)
You want this dashboard wide or just for a chart?
Hi,
The simplest solution is can provide is to create a default bookmark.
Once you set it up, when anyone opens the app, by default 2020 would be selected.
Then you can create Year filter, so as and when anyone selects any year, data will change.
How to create Default bookmark:
This should do the trick.
If you want the default filter to change based on current year, you can create a dimension and then select latest year, something like this:
If ( [YEAR] = Date(today(),'YYYY') , 'Current Year' , 'Others')
Create Dimension using the above formula, select Current Year from results and set it as default bookmark.
This way, when we are in 2021, the year will automatically change to 2021.
About the filter:
You can simply write it as : if( [YEAR] > 2018, [YEAR] , null() )
And in the chart or table, un check show null values.
Hope this helps.
@sunny_talwar Just for a single chart
@MohasinKhan how to create a filter pane having values 2019,2020,2021 only.
Okay, so by default you have 2020, but then user should have the ability to select 2019 or 2021. But what happens if the user selects 2018 or 2022? Or would this never happen? If it will never happen, then why do you even bring the other years in the app? If it can happen, what will the dashboard show in that case?
Create a filter pan with below expression
=aggr(only({<Year = {">=$(=year(today())-1)<=$(=year(today())+1)"}>}Year),Year)
then create a variable vYear at front end with below expression
=if(GetSelectedCount(Year)=0,year(today()),max(Year))
then you can use below expression in your chart to restrict it default to current year ..based on filter selection it will change.
Count( DISTINCT {$<Year={"$(vYear)"}>}id)
I want to select by default 3 years in filter pane. Please help how to do that ?