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
  • In order to do that you would need to create a custom rollupAve sugarLogic formula which suppress empty values.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Reply
  • In order to do that you would need to create a custom rollupAve sugarLogic formula which suppress empty values.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada
Children
  • is that like an IfElse statement? and would it go before the rollupAve or in between?

  • Jessica Taggart, the functionality you are seeking is not available natively in Sugar and is tracked under enhancement request # 68025 (you will need to be a support-authorized contact to view this link). I recommend filing a support case with Sugar referencing this enhancement so they can continue to weighing the importance of implementing this feature. 

    As André Lopes mentions, you could achieve this by defining a custom calculated formula. Another option would be to handle this via a logic hook. Both of those solutions require development expertise. If you do not have access to a current development team, my company, Upsert, can deliver the solution you are seeking.

  • 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!