Calculated Field - Count selections in related module

Hi all,

In our Tasks-module there's a custom dropdown field with a product selection. I would like to see what's the highest "product interest" per individual contact based on the number of tasks with the appropriate selections.

From my understanding I have to add a custom field in tasks for each selection that holds either 1 or 0 based on if that certain option is selected or not. let's call them trigger_p1, trigger_p2...

In the contacts module I would add another calculated field "counter". Here I would either add the values of each trigger field (or count those with value=1), then compare and set my desired value based on the comparison. Is this the right apporach? Seems like a lot of overhead if there are several options in the initial selection field...

PS: Unfortunately we're still running Sugar 7.9.5.0

Parents
  • Hi Daniela,

    This use case is achievable with less overhead via the countConditional formula. Using a similar use case to yours, if I wanted to count the number of tasks related to a contact that were either in a 'Not Started' status, I would use the following formula in the Contacts field:

    countConditional($tasks,"status",createList("Not Started"))

    Similarly, if I wanted to count all tasks that were in either 'Not Started' or 'In Progress' status, I would use the following formula:

    countConditional($tasks,"status",createList("Not Started", "In Progress"))

    I believe the countConditional formula is available in 7.9.5.0 based on the documentation, so this solution should be applicable.

    I hope that helps!

Reply
  • Hi Daniela,

    This use case is achievable with less overhead via the countConditional formula. Using a similar use case to yours, if I wanted to count the number of tasks related to a contact that were either in a 'Not Started' status, I would use the following formula in the Contacts field:

    countConditional($tasks,"status",createList("Not Started"))

    Similarly, if I wanted to count all tasks that were in either 'Not Started' or 'In Progress' status, I would use the following formula:

    countConditional($tasks,"status",createList("Not Started", "In Progress"))

    I believe the countConditional formula is available in 7.9.5.0 based on the documentation, so this solution should be applicable.

    I hope that helps!

Children
No Data