Filtering using different date type

My dashboard has 3 sections, and I want to use different date columns (metric date and reporting date) to filter for each section. Is there a way to create a dynamic date filter using the same parameter in control bar?

Section 1 - visuals use reporting date
Section 2 - visuals use metric date
Section 3 - visuals use metric date

I tried to create a date picker calculated field, but ideally I’d like to have date type set at default for each section without having to choose which date type to use for each visuals.
ifelse(${DatePicker} = ‘Reporting Week’, {reporting date}, {metric_date} )

If I understand correctly, you want to use a single date picker and have it match different fields on different visuals. If so, you could do this:

  1. Add a date parameter DATE and a datepicker control
  2. Add 2 calculated fields:
    First calculated field called reporting_date_match with definition:
ifelse({reporting date} = ${DATE}, 1, 0)

Second calculated field called metric_date_match with definition:

ifelse({metric_date} = ${DATE}, 1, 0)
  1. On the visuals that need to be filtered by the reporting date, add a filter on the {reporting_date_match} field with value 1

  2. On the visuals that need to be filtered by the metric date, add a filter on the {metric_date_match} field with value 1

1 Like

Hi Darcoli,

Thanks so much for the reply. I tried this method and was able to include this to my date calculation, it works! A follow up question - is there a way that I can just have the date type default to visuals in each section? So users don’t have to choose which date type in control, and the metrics will just show by the default metric date. (e.g. visuals in section 1: metric date, visuals in section 2: reporting date), and the universal date parameter in control can filter period ranges for all the date types…

Thank you for helping!
Irene

Do you mean you are giving access to users to edit the analysis? If so, then I think the cleanest way would be to separate the visuals under separate tabs and set the filters to apply to all visuals (that would apply to all visual within the same tab). Then when new visuals are added they would inherit the corresponding date filter automatically.

Hi Darcoli,

Thanks again for your reply! I actually don’t want to give users the option to choose as it can be confusing to them, so I’m looking for a way to have different date type defaulted to each section, and users will just use one date filter in control bar to choose the date range. I will keep exploring. Thanks again for your suggestion, I appreciate it!

Best,
Irene