Hello,
I am building an area line chart in QuickSight and I want to implement the following behavior:
-
By default, the chart should show the top 2 SKUs
-
At the same time, the user should be able to search/select any SKU, and that SKU should also appear on the chart even if it is not in the top 2.
Current Setup
Date
Dataset-level field used on the X-axis.
Brand SKU
concat(Brand, ' - ', {Product Name}, ' ', '(', SKU, ')')
SKU Rank
rank(
[sum(units) DESC],
[Date]
)
What I Tried
I created a parameter linked to the SKU field and attempted to build a calculated field like this:
ifelse(
{SKU Rank} <= 2 OR {Brand SKU} = ${SKUSelector},
1,
0
)
However, this returns the following error:
“Mismatched aggregation. Custom aggregations can’t contain both aggregated and nonaggregated fields.”
This happens because:
-
{SKU Rank}is an aggregated/table calculation -
{Brand SKU}is a dimension (non-aggregated)
Desired Behavior
Default chart:
Top SKU 1
Top SKU 2
If user searches/selects a SKU:
Top SKU 1
Top SKU 2
Selected SKU
Question
We want similar pattern in QuickSight where:
-
Top N items are shown by default
-
but users can dynamically add any selected item to the same visual
without running into aggregation mismatch errors? Any workaround using parameters, filters, LAC/table calculations, or alternative design patterns would be greatly appreciated.
Applying the SKU Rank <= 2 filter removes all other SKUs from the visual, so even if a user searches/selects another SKU, it does not appear because it has already been filtered out
Additional Question (Tooltip Ordering)
Currently, the tool-tip shows multiple SKUs but not in rank order. For example:
Is there any way to make the tool-tip appear sorted by rank, such that it displays:
SKU Rank
A 1
B 2
C 3
when hovering over a date point?
Thanks








