Filtering using regex

Hi,
My dataset is updated on a monthly basis to provide new month and new quarter data. One of my Quick Sight dashboard only shows quarterly and YTD data. This is how I set the filter:

However, when I have new quarter data for Q3 and Q4, I have to manually include Q3 and Q4 in the filter. I’m wondering whether there is a way to automatically include new quarter data to the filter. For example, setting filter using regex, so it can capture all the QX data that’s fed in the future. Thank you!

Hi @luckymeow

To automatically include new quarterly data (like Q3, Q4, etc.) without manually updating the filter in Amazon Quick Sight, you can try the following approaches:

You can leverage Quick Sight’s built-in dynamic date filters instead of relying on specific quarter labels (like Q1, Q2). This approach works better for date-based filtering:

  • You can use Relative filters, like “This quarter” or “Last 4 quarters,” that automatically adjust based on the dataset updates.
  • This method avoids the need for regex and captures new quarter data as long as they are recognized as dates.

Sorry, currently this feature regex in filters is not supported in Quick Sight, but you can create a calculated field to capture quarter values dynamically based on patterns. Create a calculated field in your dataset using functions like ifelse to check if the date falls under a specific quarter. This calculated field can return values like “Q1,” “Q2,” etc.

Example: (Syntax may vary)

ifelse(
   extract("Q", {DateField}) = 1, "Q1",
   extract("Q", {DateField}) = 2, "Q2",
   extract("Q", {DateField}) = 3, "Q3",
   extract("Q", {DateField}) = 4, "Q4",
   "Unknown"
)

Apply a filter on the calculated field to include all values starting with “Q”.

If you are using SQL-based datasets, you can pre-process your data in the data prep phase to automatically categorize or tag quarterly data and apply filters accordingly.

I hope this helps!

1 Like