- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assign default value to variable input dropdown
Hi,
I have built a dashboard that uses a variable as time dimension in visualizations. The variable $(day_date_var) is defined as date(day_date). The user can select if he wants to see data aggregated on a daily, weekly or monthly basis by selecting either option from a dropdown (via variable input extension).
The variable values within the dropdown are defined as the following:
Daily: date(day_date)
Weekly: WeekEnd(day_date)
Monthly: Month(day_date)
Now, when the dashboard is opened, the default option in the dropdown is always "Daily". How can I change this to "Weekly" being the default option?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Create a variable and pass WeekEnd(day_date) as a value for that variable and set that variable in your drop down extension.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Instead of defining the day_date_var as date(day_date), define the variable with weekend (today()) or likewise.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your feedback. Defining the variable as WeekEnd(day_date) works in that sense that the visualizations get rendered aggregated on a weekly basis, so that's cool 🙂 But the dropdown menu that I use to give the user the chance to change the aggregation level still shows "Daily" instead of "Weekly", thus misleading the user 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sadly, I wasn't able to find a solution yet. Does someone have another idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Create a variable and pass WeekEnd(day_date) as a value for that variable and set that variable in your drop down extension.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you explain for the dropdown is created and why the selection is pointing to the Daily.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the default value for the variable which you have pulled for drop-down in variable input button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
After some testing the way that you suggested works! I initialize the variable now as WeekEnd(day_date) and that did the trick. I don't know why I saw the weird behavior before but now the dropdown shows the correct value 'Weekly' as well.
Thank you!