Documentation

gwp_sum_matched_entries_values

The gwp_sum_matched_entries_values Modifier can be used to calculate the sum of a field value in multiple entries of a certain form (the same or another), based on a shared value with optional extra filters.

:gwp_sum_matched_entries_values form_id= match_id= return_id= filter1= operator1= value1= filter2= operator2= value2=

The minimum requirements when using the Modifier are:

  • form_id: ID of the Form with the entries you want to calculate the sum of.
  • match_id: ID of the Field within that Form you want to match the value of the Merge Tag’s field value to.
  • return_id: ID of the Field that you want to get the sum of the values of.

Optionally you can add one or more filters to only calculate the sum of the filtered entries. Supported operators are: ‘is’, ‘isnot’, ‘contains’, ‘greater_than’, ‘less_than’, ‘greater_than_or_is’, ‘less_than_or_is’.

Examples

{PROJECT_ID:21:gwp_sum_matched_entries_values form_id=19 match_id=8 return_id=11}

{Textfield:1:gwp_sum_matched_entries_values form_id=2 match_id=1 return_id=5 filter1=3 operator1=isnot value1=complete filter2=created_by operator2=is value2=1}

Matches all entries in Form 2 where Field 1 has the same value as {Textfield:1}. The total sum of Field 5 is returned, but only entries where the Field 3 value is ‘complete’ AND where created_by is the User with user-id 1.

{PROJECT_ID:21:gwp_sum_matched_entries_values form_id=19 match_id=8 return_id=11}

Finds all entries where Field 8 in Form 19 has the same value as {PROJECT_ID:21}. The total sum of the values in Field 11 of the matching entries in Form 19 is returned.

Last updated: 19-11-2024

Advanced Merge Tagsv1.9.1

To use the functionalities described in this documentation, you'll need to get the GravityWP - Advanced Merge Tags add-on.

Read more