[Dataset Calculated Field] Create if else with return column name or null

Hi everyone,

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})

Does anyone know how to fix this?

Thanks in advance!

Hi @Barbara

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.

Regards,
Giri

Hi @Barbara

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.

Regards,
Giri

Hi @Barbara

It’s been a while since we last heard from you. If you have any further questions, please let us know how we can assist you.

If we don’t hear back within the next 3 business days, we’ll proceed with close/archive this topic.

Thank you!