PercentileDisc issues with LAC Segments

Hello everyone,

I am currently trying to implement the PercentileDisc function with included LAC function.
So I want to add the following calculated field to my analysis

percentileDisc({Avarage availability},95,[{Service}])

But I get the Error message:
Nesting of aggregate functions like NESTED_PERCENTILE and NESTED_PERCENTILE(AVG(“Availability”), 95, “Service”) is not allowed.

I was following the documentation

Does anyone have an idea how I can fix this.
Greetings
Felix

Hello @Felix_Krall !

Is {average availability} a calculated field in your analysis and if so what does that calculation look like?

Hello @duncan ,
no it is a regular measure with a Format “number”.
Greetings
Felix

Hey @Felix_Krall !

After some testing I found that if the value is just an integer/number you should be able to save the calculated field, but if the metric that you are trying to run the function on is being averaged in the data prep layer you will still hit this error. For example:

percentileDisc({Sales},95,[{Region}]): This calculated field works because {Sales} is just returning an integer and is not aggregated anywhere on the data prep layer or the analysis layer.

percentileDisc({Average_sales},95,[{Region}]): But this returned the nesting aggregation error because {Average_sales} is a calculated field on the data prep layer.

I would suggest double checking your dataset in the data prep layer to double check that the field is not being aggregated there.

Hi @duncan ,

thank you for your feedback.
We did test this but now we get the error that the function only takes 2 Arguemnts

Greetings
Felix

@Felix_Krall ,

Adding to what @duncan said

1/ Nested LAC-A calculation is not supported at the moment .[Using level-aware calculations in Amazon QuickSight - Amazon QuickSight]

2/ In your latest screenshot , if you tried creating the calculation in the data prep layer, it will not work as aggregate functions are added in the analysis layer. LAC-A is applicable in the analysis and not in data prep.
( Adding calculated fields - Amazon QuickSight )

In data prep : Sales is a measure coming from the datasouce

percentileDisc({Sales},50) will work

In Analysis, LAC-A will work :

percentileDisc({Sales},50,[Region]) will work

Kind regards,
Koushik