Calculation Procedures / Matrices Flashcards
What is a Calculation Matrix?
They are lookup tables that take a unique input or set of inputs and return an output or set of outputs. Use a Calculation Matrix whenever you need to look up data.
here are a few examples of Calculation Matrices.
An insurance premium matrix that matches characteristics of the insured to policy premiums
A weather alert matrix that sets an alert flag based on weather conditions
A demographic matrix that outputs demographic data based on a location
A pricing matrix that matches a set of product characteristics to a price or prices
What are the 3 types of Calculation Matrices?
Standard Calculation Matrix: Used when your matrix doesn’t need to be a part of a group or versioned row by row.
Grouped Calculation Matrix: Used to group similar matrices with the same Input and Output headers together.
Row-Versioned Calculation Matrix: Used if you have a matrix with many rows and may need to change small portions of the data at a time. Each row has its own start date and time
What factors to consider that determine which matrices run?
A matrix will only run if the current date and time is between the Start Date/Time and End Date/Time. A matrix with a blank End Date/Time still runs; it is merely set up to run indefinitely.
If there are multiple versions of a matrix, only one version can be accessed at a time, based on these factors:
*The date/time range on the matrices. (That is, are they active at the same time?)
*If they are both active, the highest priority active matrix is the one that runs. (1 is the lowest priority.)
The previous versions of a matrix will always be available to allow products with old prices to still access the proper price tables.
What needs to be unique in matrices?
(Combinations of) inputs. Outputs do not have to be unique. In other words, the lookup can be many-to-one.
If two matrices are both enabled at the same time, which one will be called?
the one with higher priority (1 = lowest)
What are Calculation Procedures?
OmniStudio Calculation Procedures allow you to perform multiple mathematical operations and transformations at the same time. They take inputs as formatted JSON data and use lookup matrices, algebraic operations, and aggregation operations to calculate new data. They output specified data in formatted JSON and they can have conditional steps.
Calculation Procedures are used to configure matrix lookups, set variables and constants, and perform basic math operations.
Why use Calculation Procedures, when other features support formulas?
Calculation Matrix integration
Built-in JSON array calculations and aggregation functions
Server-side execution
Time-based execution (You can have multiple versions in place that automatically execute based on when the data call is made.)
What are the 5 basic components of a calculation procedure, and which ones are required?
Required:
Variables and Constants: Used in calculation steps
Optional:
Calculation Steps: Matrix and Lookup
Aggregation Steps: Allow you to use data from an array input where the calculations are run on each element separately
Preprocessor Class: Apex classes used to manipulate the input of the calculation
Postprocessor Class: Apex classes used to manipulate the output of the calculation
You insert a Matrix Lookup calculation step, but your matrix isn’t listed as you type it out. What could be the reason?
The matrix may not have been enabled
What must the input JSON node for a calculation procedure be named?
input. All lowercase.
What are the two different types of calculation steps in a Calculation Procedure?
Matrix lookup, and Calculation (aka formula)
If two Calculation Procedures are both active at the same time, which one will be called?
Same rule as with Matrices; the higher priority one. (1 is lowest)