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
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.
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.
${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
The filter is configured as shown below
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 :
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})’.
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:
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.
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