I need some help with a calculation I’m trying to implement. I want to check if the rank_version is less than or equal to 3. If it is, the formula should return the value of the Version column; otherwise, it should return NULL. However, I’m getting the following error:
ifelse({rank_version} <= 3, {Version}, NULL)
*Mismatched aggregation. Custom aggregations can't contain both aggregated and non-aggregated fields, in any combination.*
For context:
{rank_version} is a calculated field defined as rank([{Version} DESC])
{Version} is also a calculated field: coalesce({DEV_VERSION}, {QA_VERSION}, {STAGE_VERSION}, {PROD_VERSION})
The complaint basically is that you are comparing an aggregated field (rank_version) to a non-aggregated field (version) which comes from individual rows of data.
The following article should help clear your doubts on this.
Applying a Max on both the fields in your ifelse statement may make the error disappear; but you should be driven how you are trying to compare data. So reviewing the article in detail would be a good approach before you re-attempt your calculation.