Hi Team,
I need help with creating a PRT% bucket dimension in QuickSight for grouping machine counts by location.
My requirement
I want a pivot/matrix like this:
PRT% Bucket | Location A | Location B | Location C
---------------------------------------------------
0β30 | X | Y | Z
31β50 | X | Y | Z
>50 | X | Y | Z
This requires the PRT% Bucket to be a dimension so I can place it in ROWS.
Current Data Structure
-
prtinsec(int) -
statusasonist(timestamp) -
Dynamic date parameters
${StartDate}/${EndDate} -
Multiple rows per machine per day
My Calculated Fields
1. Machine_PRT_Sec
sumIf(
prtinsec,
truncDate('DD', statusasonist) >= ${StartDate}
AND truncDate('DD', statusasonist) <= ${EndDate}
)
2. Working_Day_Count
dateDiff(${StartDate}, ${EndDate}, 'DD') + 1
3. Machine_Working_Sec
maxOver(
86400 * {Working_Day_Count},
[{machine_name}]
)
4. Machine_PRT_Percentage
({Machine_PRT_Sec} / {Machine_Working_Sec}) * 100
5. PRT % Bucket
ifelse(
{Machine_PRT_Percentage} < 30, "0β30",
{Machine_PRT_Percentage} <= 50, "31β50",
">50"
)
Problem
QuickSight shows this error when I drag PRT % Bucket into Dimensions (Rows):
Custom aggregation field is not allowed as a dimension
Even though:
-
Machine_PRT_Percentageis aggregated inside the formula -
I am using
sumOver/maxOverscoped bymachine_name -
The bucket logic is simple ifelse
What I Need
I want to confirm:
-
Is it possible to create a dimension bucket from an aggregated measure in QuickSight?
-
If not, is pre-calculating PRT% bucket in ETL/Athena the only supported solution?
-
Why do LAA functions (
sumOver/maxOver) still result in the bucket being treated as a MEASURE? -
What is the recommended way to achieve group-wise bucketing (e.g., β0β30β, β31β50β) when the underlying value depends on aggregations + date parameters?
Any official guidance or best-practice patterns will be very helpful.
Thanks!