Trying to create a rollupAve of a number, where it doesn't count fields that are empty?

I've created a calculated field where I've successfully created a rollupAve function to a related module:

rollupAve($contacts_rtc_session_2,"avg_speaker_score_c")

This works great, but I'd like for it NOT to include in the calculation any instances where the field "avg_speaker_score_c" is empty. Is this possible? If so what do I need to change the formula to?

Parents Reply
  • Hi Jessica Taggart,

    One way this can be handled with calculated fields:

    Make a new checkbox in the module that has the avg_speaker_score_c field. Name the field "is_avg_populated_c". Put this calculation in that field:

    greaterThan(strlen(toString($avg_speaker_score_c)),0)

    Then, in the field you are currently trying to calculate with the average formula, you can use a formula like this:

    divide(rollupConditionalSum($contacts_rtc_session_2,"avg_speaker_score_c","is_avg_populated_c",true),countConditional($contacts_rtc_session_2,"is_avg_populated_c",true))

    I hope this helps!

Children