Skip to main content

Hi,

I want to calculate the minimum of the following calculated column of an OLAP table:

 

SUM (CASE WHEN "Internal_Contol_BD_KPI"."RESULT_VALUE_2" = 'FAIL'

THEN "Internal_Contol_BD_KPI"."CONTADOR"

ELSE NULL

END) / SUM ("Internal_Contol_BD_KPI"."CONTADOR")

 

but when I try to apply MIN() to all that expression, the following error occurs: "Aggregate expressions cannot be nested inside aggregate expressions."

 

Then, how can I obtain the minimum of that calculated column?

 

I though a solution may be using PU functions, but since there is only one table in my analysis, it is not possible.

 

Regards

Hi @leonor.doris.rodri ,

 

Did you try substituting the first SUM with MIN, it would look like this:

 

MIN (CASE WHEN "Internal_Contol_BD_KPI"."RESULT_VALUE_2" = 'FAIL'

THEN "Internal_Contol_BD_KPI"."CONTADOR"

ELSE NULL

END) / SUM ("Internal_Contol_BD_KPI"."CONTADOR")

 


Hi @leonor.doris.rodri ,

 

Did you try substituting the first SUM with MIN, it would look like this:

 

MIN (CASE WHEN "Internal_Contol_BD_KPI"."RESULT_VALUE_2" = 'FAIL'

THEN "Internal_Contol_BD_KPI"."CONTADOR"

ELSE NULL

END) / SUM ("Internal_Contol_BD_KPI"."CONTADOR")

 

Hi @1460067637 

 

Thanks for your response. That doesn't work for me because I need the MIN of the division of both SUMs:

 

MIN (SUM_1/SUM_2)


Reply