MetaData - Processing Rules - Mathematical Functions

Revision as of 22:21, 7 February 2017 by Philip Lacey (talk | contribs) (Created page with "= Overview = For more information on {| class="wikitable" ! Area ! Link |- | MetaData please refer here || MetaData_-_Start_Here |- | Processing rules please refer here...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Revision as of 22:21, 7 February 2017 by Philip Lacey (talk | contribs) (Created page with "= Overview = For more information on {| class="wikitable" ! Area ! Link |- | MetaData please refer here || MetaData_-_Start_Here |- | Processing rules please refer here...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Field Containing the first number
  5. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Field Containing the first number
  5. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Field Containing the first number
  5. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Field Containing the first number
  5. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Field Containing the first number
  5. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Form id (the same as the current sequence)
  5. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Form id (the same as the current sequence)
  5. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Form Id to Search in
  5. Fields to search on
  6. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. 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:

  1. Rule Name
  2. Form id (the same as the current sequence)
  3. Field to store the end result
  4. Filed to group by
  5. 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-]]