Ifelse error code: Mismatched aggregation

Hi Team,

I got an error message with below calculated field:
error code: ‘Mismatched aggregation. Custom aggregations can’t contain both aggregated and non aggregated fields, in any combination’
Below is my calculations with error code:
ifelse({recommendation for customer}=‘Add’,{recommended_action_type},
{recommendation for customer}=‘Maintain’,’ ',NULL).

Additional Info:
{recommended_action_type} is just a dimension from dataset.
recommendation for customer:
ifelse(max({is_csm_assigned})=1 and {Recommendation Type}=‘Maintain or Add’,‘Maintain’,

max({is_csm_assigned})=1 and {Recommendation Type}=‘recommended_allocation_model’,‘-’,

max({is_csm_assigned})=0 and {Recommendation Type}=‘Maintain or Add’,‘Add’,

max({is_csm_assigned})=1 and {Recommendation Type}=‘Remove or Keep No Coverage’,‘Remove’,

max({is_csm_assigned})=0 and {Recommendation Type}=‘Remove or Keep No Coverage’,‘Keep No Coverage’,NULL


1 Like

Hello @Cindy, so my first thought is that this error is being triggered because you are checking for max on the is_csm_assigned field and then trying to display an unaggregated field in your 2nd ifelse statement recommended_action_type. What data type is your recommended_action_type field returning? Is it another string value?

Thanks for your reply @DylanM ,

recommended_action_type is from the data set without any manipulation. Data type is string

Hello @Cindy, I have a thought on this. So, it isn’t going to let you run the 2nd calculated field with the ifelse statement because you are using the max aggregation on your {is_csm_assigned} field. I am wondering though, if you built the recommendation for customer field on your dataset rather than the analysis, then created the ifelse statement with the error on your analysis level, if it would bypass the aggregation error. That is my best thought on how to work-around this at the moment. Let me know if that helps!

1 Like