Mismatched aggregation. Custom aggregations can't contain both aggregated and nonaggregated fields, in any combination

hi
getting this type of error (Mismatched aggregation. Custom aggregations can’t contain both aggregated and nonaggregated fields, in any combination.) while using this calculation

ifelse(${Selectmeasure}=‘Loan Amount’,

[({Loan Status}=‘Current’ OR {Loan Status}=‘Issued’ OR {Loan Status}=‘Fully Paid’),sum({Loan Amnt})]

,[({Loan Status}=‘Current’ OR {Loan Status}='Issued’OR {Loan Status}=‘Fully Paid’),count({Loan Amnt})])

I would make it a nested ifelse

ifelse(${Selectmeasure}=‘Loan Amount’,
sum(ifelse(({Loan Status}=‘Current’ OR {Loan Status}=‘Issued’ OR {Loan Status}=‘Fully Paid’),{Loan_Amount},0)),
count(ifelse(({Loan Status}=‘Current’ OR {Loan Status}=‘Issued’ OR {Loan Status}=‘Fully Paid’),{Loan_Amount},0)))

2 Likes

Hi @Prashanthkc. We hope the response from @Max helped you. Let us know if this is resolved. And if it is, please help the community by marking the answer as a “Solution”. Many thanks.

2 Likes