Default Date Filter on an Embedded Dashboard

(NOT USING DATA RANGE)

I am wanting to filter data by Week ( 1, 2, 3, 4, 5, 6, etc..), but I am having trouble finding a solution that will allow me to 1. have a default filter that will open up the dashboard to the current week and then 2. being able to filter by other weeks.

Here's what I have tried:

  • Using the Beast mode below I can get the highest week (or current week) but then I am not able to use the "Week" field to filter on. When I want the Week filter to show the options 18, 19, 20, 21, 22 (which it originally does) it will only show the option for week 22 when using this Beast mode.

CASE 

WHEN `Year` = YEAR(CURRENT_DATE) AND `Week` = WEEK(CURRENT_DATE,0) THEN 'True'

ELSE 'False'

END

  • Using a modified version of the beast mode above, I am able to get the highest week (current week) and also see and filter on other weeks (18, 19, 20, 21, 22). This is exactly what I wanted, but now that the next week has started, I noticed that the filter did not change from 21 to 22.

CASE 

WHEN `Year` = YEAR(CURRENT_DATE) AND `Week` = WEEK(CURRENT_DATE,0) THEN CEILING(`Week`)

ELSE `Week`

END

If anyone has a solution that doesn't require using the Date Range filter, I'd love to hear from you.

Comments

  • To meet your first requirement, you can set a default filter for a page.

    If you're doing it in ETL you might have a "isMostRecentWeek" binary column (a 0 or a 1) and then by default always filter to 1.


    To accommodate your second requirement, we always recommend configuring a date dimension with a week column (i assume you mean week of year). You do have to be careful with beast modes because the start and end of the year can be tricky (when do you start counting the first week of the year? it differs by company).

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • @jaeW_at_Onyx

    Thanks for your reply.

    Sorry for my poorly written post. To clarify, I have a week of year column in the dataset called 'week' (the 'week' column currently has weeks 19, 20, 21, and 22), and I want to be able to filter on those weeks along with having the current week (22) be the default page.

    Now with this beast mode

    CASE 

    WHEN `Year` = YEAR(CURRENT_DATE) AND `Week` = WEEK(CURRENT_DATE,0) THEN 'True'

    ELSE 'False'

    END

    I set the default page to 'True' and that indeed gives me the current week (22), BUT now when I try to filter by week using the 'week' column, the only option to filter on is 22 ( 19, 20, 21 are gone).

    I hope this makes more sense.


    To reply to "If you're doing it in ETL you might have a "isMostRecentWeek" binary column (a 0 or a 1) and then by default always filter to 1.", Unless I'm mistaken, I think the beast mode I am using is doing pretty much the same thing as this.

  • @Airwon48, no your description made sense. you currently can't have a filter enabled (which excludes data) and then filter on excluded data.

    That's why you'd use the default page filter, sorry forgot to link the KB, https://domohelp.domo.com/hc/en-us/articles/360042923914-Applying-Page-Level-Filters-with-Filter-Views

    users would then have to deselect the default filter and then look for something else.

    Jae Wilson
    Check out my 🎥 Domo Training YouTube Channel 👨‍💻

    **Say "Thanks" by clicking the ❤️ in the post that helped you.
    **Please mark the post that solves your problem by clicking on "Accept as Solution"
  • Airwon48
    Airwon48 Member
    edited May 2022

    @jaeW_at_Onyx

    I see. I would like to use the default page filter (date range), but there are times when some weeks are long weeks (8-9 days) and overlap the following week, which is the main reason why we have a custom week column based off our company needs. Because of this - we can't use the default date range page filter.

    I currently have the default page set up where it will give me the current week, but then the users have to do what you said, "deselect the default filter" and then filter on the other weeks they want to look at.

    I was just hoping there was a way around not having to deselect the default page every time they want to filter on a different week.

    From your experience, do you think if I made a binary column "isMostRecentWeek" in Magic ETL like you previously explained and then filtered on that for my default page -- would I be able to filter on the other weeks without having to deselect the default filter page? (if I just think about it-- i would say that it would still run into the same problem where I'd have to deselect that filter before filtering on other weeks, but if you have any other insights on that -- I'd love to hear them)


    Thank you!