MetaData - Processing Rules - Mathematical Functions
From All n One's bxp software Wixi
Contents
1 Overview
For more information on
| Area | Link |
|---|---|
| MetaData please refer here | MetaData_-_Start_Here |
| Processing rules please refer here | MetaData_Process_Rules |
| Parameter construction please refer here | MetaData_Program_and_Outcomes |
2 Reference
This wixi article is meant to serve as a reference guide to a subset of MetaData Processing Rules.
3 Rules
3.1 Addition
The addition rule allows for any two numbers stored in database fields to be added together.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Field Containing the first number
- Field Containing the second number
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]First Number field[[-SEP-]] Second Number field[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Add[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]] strCDA_1_field_0_3[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.2 Subtraction
The subtraction rule allows for any two numbers stored in database fields to be subtracted.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Field Containing the first number
- Field Containing the second number
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]First Number field[[-SEP-]] Second Number field[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Subtract[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]] strCDA_1_field_0_3[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.3 Multiplication
The multiplication rule allows for any two numbers stored in database fields to be multiplied together.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Field Containing the first number
- Field Containing the second number
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]First Number field[[-SEP-]] Second Number field[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Multiply[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]] strCDA_1_field_0_3[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.4 Division
The division rule allows for any two numbers stored in database fields to be divided by each other.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Field Containing the first number
- Field Containing the second number
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]First Number field[[-SEP-]] Second Number field[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Divide[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]] strCDA_1_field_0_3[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.5 Modulus
The Modulus rule allows for any two numbers stored in database fields to be mod’ed together to get the remainder.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Field Containing the first number
- Field Containing the second number
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]First Number field[[-SEP-]] Second Number field[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Modulus[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]] strCDA_1_field_0_3[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.6 Numeric
The numeric rule allows for any of the database fields to be converted into a number i.e. Make sure the contents are a number. If the contents are not recognised the field is defaulted to 0.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Form id (the same as the current sequence)
- Field Containing the value to be converted
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]Form Id[[-SEP-]] Field to be converted[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Numeric[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]1[[-SEP-]] strCDA_1_field_0_1[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.7 Summation
The summation rule allows for any of the database field to have their contents summed together for the entire group of records returned by the Sequence, this summation value is then stored in all of the records that were included in the summation.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Form id (the same as the current sequence)
- Field to summate
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]Form Id[[-SEP-]] Field to summate[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Sum[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.8 Count
The count rule allows for the counting of the number of records returned by the sequence. The count value is then store in every record returned by the sequence.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
Count[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.9 Is Unique
This function can be used to see if this records value is unique or exists elsewhere. Is Unique will return the string “True” or “False” into the source data field
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Form Id to Search in
- Fields to search on
- Filed containing the search value
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]Search Form Id[[-SEP-]]Field to search on[[-SEP-]]field value to search with[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
IsUnique[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]2[[-SEP-]]strCDA_2_field_0_1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.10 Group Count
This function is used to group values, count them up and store the count in a field of those “grouped” records.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Filed to group by
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]field to group on[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
GroupCount[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
3.11 Group Sum
This function is used to group values, total them up (despite them being stored as strings) and store the count in a field of those “grouped” records. Sum will also compensate for text data being in the fields as well as null and empty values.
Required fields to execute rule:
- Rule Name
- Form id (the same as the current sequence)
- Field to store the end result
- Filed to group by
- Field containing the values to summate
Example:
Rule Name[[-SEP-]]Form Id[[-SEP-]]Destination field[[-SEP-]]field to group on[[-SEP-]]Field containing the values to summate[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]
Example (with replacement values):
GroupCount[[-SEP-]]1[[-SEP-]]strCDA_1_field_0_1[[-SEP-]]strCDA_1_field_0_2[[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]][[-SEP-]]