Control Filter with Rolling Default by date?

Hi everyone,

I am building a dashboard with visuals that show sales at an event selected by a control filter. Currently the event list in the filter is sorted by date, but I have the default set to blank because I couldn’t figure out how to set the default to be the event on the most recent date. Is there a way to do this?

event_date is a separate field from event_name, but I have the list sorted already so if there is a way to select the top item in the list for the filter by default then that would be ideal.

If anyone can help, I would greatly appreciate it!

Hi @speyerb,

Welcome to the Quick Community! A workaround you can try is to create a calculated field like this…

ifelse(
    Date = maxOver(Date, [], PRE_AGG),
    1,
    0
)

…and you can put a filter control on it and you can reset your visual view to the “True” case.

Please let me know if this workaround is applicable to your use case. If not, please let us know and we can try a different approach.

Thank you!

Hi Luis. Thanks for your suggestion. I’m afraid this is not applicable to my approach because I am trying to modify the default value selected in a parameter/control, not a visual. Is there anyway to make the parameter default dynamic in this way I am describing?

Hi @speyerb

You may need to use a prefix to your field that you want in the filter (add as an additional field in your dataset) to make it show in the order you want.

The sort order is not part of the options in the parameter. So you need to handle it in your field name itself.

Hi @Giridhar.Prabhu ,

I have already built a separate calculated field like you mentioned that sorts the values in the control’s dropdown by event_date. Sorting is no longer the issue, I am trying to set the parameter’s default value as the most recent date, using a separate calculated field.

Correct me if I am wrong. but unfortunately, parameters don’t seem to support the option for dynamic default values based on other calculated fields, which is the functionality that I am looking for. They only allow for static values, blank, or dynamic values based on users rather than other fields. I hope this feature gets added soon.

Thanks all for looking into this!

Hi @speyerb ,

You might consider trying a separate rules dataset with a “dummy” dynamic default paremter (DDP).

Would look something like this:

  • Create a dataset with the ARNs of all users (or group of users) who use the report, and a default_datecolumn (should always reflect the latest event date)
  • Add that dataset to the analysis
  • Set up the dynamic default value to be the default_date column value

Result: Parameter is always set to the latest event date whenever a user opens the report

These might be more hoops to jump through than you’re looking for - but it should get you the result you’re looking for.

If your org has some way to query the current Quick user ARNs via SQL, you could set it up as a query and there wouldn’t be much of a maintenance burden.

Good luck!

Dave

Hi @speyerb,

Just checking back in since this thread hasn’t received a response in a while. Was Dave’s reply helpful to you and/or were you able to find a solution yourself in the meantime? Please help the community by marking this answer as “Solution” or following up in general within the next 3 business days!

Thanks!

Hi @speyerb,

Since I haven’t received any further updates from you, I’ll treat this inquiry as complete for now. If you have any additional questions, feel free to create a new post in the community and link this discussion for context.

Thanks!