URGENT_Date filter clarification

Hello,

We are trying to create drop down to the user where they can review the visuals by dates like below:

Current Year (Year to Date)
Previous Year
Current Quarter
Last Quarter
Rolling Last 4 Quarters
202401
202402
202403
202404
202405 etc etc

We have period field which contains : 202401,202402 etc dates (dataset level field) :

For Date span like:

Current Year (Year to Date)
Previous Year
Current Quarter
Last Quarter
Rolling Last 4 Quarters

I have created below parameter driven calculated field and applied as a filter = 1 across the visual.

Calculated field :

Filter :

Control of ${DateChoice} parameter :

The rest of the functionality is working well. However, I now need to add a feature where selecting “Custom Period” activates only the Period filter. When “Custom Period” is chosen, users should be able to pick the desired period as shown in the screenshot below.

Right now, the Period filter is overlapping with the pre-aggregated date options, so I want the system to use either the pre-aggregated dates or the Period filter

We have a requirement as follows:

Our clients are use to seeing pre-aggregated date selections alongside the regular monthly period selections. Examples of the pre-aggregated options include:

Current Year (Year to Date)
Previous Year
Current Quarter
Last Quarter
Rolling Last 4 Quarters
202401
202402
202403
202404
202405 etc etc
……….

We will need some discovery to determine whether this combined approach is feasible in QuickSight or if we will need to implement a workaround. Ideally, we want to create one filter that includes both these pre-aggregated dates and the standard monthly periods.

Any update on this?

The current method I’ve implemented uses the following formula applied as a filter (set to equals 1) on the relevant visuals. This ensures the visuals behave correctly based on the selected date logic.

We have Two Parameters here :

  1. ${DateChoice}- it has pre-aggregated dates
  2. ${PeriodChoice} - Linked to the period field (dataset level field)

I’ve added a rule in the free-form layout to display the ${PeriodChoice} control only when the ${DateChoice} parameter is set to “Custom Period.” If any other option is selected, the ${PeriodChoice} control stays hidden

image

image

The filter is configured as shown below

image

The only remaining issue when the user selects All period from PeriodChoice parameter control dropdown, the visuals return no data. To avoid this, I added an “All Period” option under the DateChoice parameter and disabled the “Select All” option for PeriodChoice Parameter — but if the user accidentally selects every period manually, the visual still goes blank.

Is there any way to prevent this behavior or force QuickSight to treat a full selection the same as “All”?

Case 1 : All other Periods are selected expect any one Period then we have data :

Case 2 : If all Periods are selected then no data (even though select all option is disabled from parameter control) :

Problem Causing Part :

Parameters Overview :

${PeriodChoice} :

${DateChoice} :

Please confirm if the current setup works — ALL periods go into the DateChoice parameter, and “Select All” is disabled from PeriodChoice parameter control. Is this approach fine, or do you see a better workaround?

Hi @soham,
One quick note to take into consideration when creating new posts; as soon as an additional post gets added to a topic, the topic automatically gets removed from the ‘New’ and ‘Unanswered’ sections, whether it’s from the original poster or not. This is most likely why your post was missed/remained unanswered. In future scenarios, please make sure to edit your original post so that it remains in the unanswered section of the community.

In regards to your issue, what if you set the default to ‘NULL’ and tried adding some logic to calc field to account for this; like ‘or in (‘NULL’, {$parameter})’.

1 Like

Hello @Brett

Thank you for your response.

just wanted to check (bit confused here) how adding the null will overcome below issue :

Case 2 : If all Periods are selected then no data (even though select all option is disabled from parameter control) :

image

Hi @soham,

Even if you disable the option to ‘select all’, if all available options are selected, it will act like ‘Select All’ since all values are selected. Take a look at this old post as it covers a similar topic:

1 Like

Hi @soham , to implement this as a single visual you could use a table with 2 columns instead of a filter:

  • period: Current Year…. , Custom Period, 202101, 202102…
  • is_selected: shows checked checkboxes in selected rows using conditional formatting

You will be able to hide periods like this 202101, 202102… when ‘Custom Period’ is not checked, ignore attempts to check inappropriate rows… But you will have to use parameters, calculated fields and interactions and complex calculations to filter data (can affect performance). And, finally it can appear to be inconvenient.

I would propose using a visual connected to a parameter periodType with 2 options

  • Standard Period
  • Custom Period

If periodType=’Standard Period’ then a dropdown (connected to a filter) with these values is shown (single select!!): Current Year (Year to Date); Previous Year; Current Quarter; Last Quarter; Rolling Last 4 Quarters.

If periodType=’Custom Period’ then a dropdown (connected to a filter) with 202101, 202102 … is shown.

You can use 2 visuals (dropdowns) and hide one of them (a very simple solution) or you can use a single one (But in the second case you likely will have to use some tricks to make the values in the dropdown dependent on the parameter. Fortunately, there is a solution in recent topics.). Anyway this approach could probably provide you with a good combination of convenience and simplicity.

2 Likes

Hello @Brett and @Hrolol

Thank you so much for your guidance.

The PeriodChoice parameter is now fully sorted — we can view the data even when Select All is used, and the visuals no longer turn blank.

I’ve set ALL_VALUES as the default for the PeriodChoice parameter, and the calculated field has been implemented as follows:

${DateChoice} = 'Custom Period'
    AND (
            in(NULL, ${PeriodChoice})        -- All periods selected
            OR in(Period, ${PeriodChoice})   -- Specific periods selected
        ),
    1,
0

This setup is working smoothly and handling both “All” and custom selections correctly.

Thank You,

Nikhil.

1 Like