A Calculated Attribute (CA) is a read-only value about a single user, providing granular insight into user behavior. These attributes are defined in mParticle and are computed automatically over time by using the raw data stream of events and user information.
Calculated attributes can be defined to track almost anything on an individual user. A calculated attribute is composed of the following elements:
draftstatus indicating that they are no being calculated. Once activated, calculated attributes are in the
activestatus to indicate that they are being calculated and can be used across the mParticle platform and downstream.
Calculated attributes are defined and calculated in the scope of a single workspace, which means they use data available within that workspace only. You may create calculated attributes with the same name in multiple workspaces.
Once a calculated attribute is activated, the initialization of existing data can take anywhere from 24 hours to several days, depending on the date range selected and the amount of data to be processed.
Calculations are either instant or delayed. Instant calculations are evaluated immediately and updated values are included in the same outgoing event batch with no delay.
Delayed calculations are evaluated with a small delay (usually a few minutes) and updated values are included in the next outgoing event batch and to outputs connected to a special feed input named “Calculated Attributes” (more about this feed).
We currently support 13 calculations organized into four groups:
count of times an event has occurred. For example:
Calculate statistics about event attributes:
most frequent and
unique values count.
In the event of a tie,
most frequent will pick the last value sorted alphabetically.
Calculate the timestamp or an event value of the first or last observation of a matching event:
last value and
unique list of values for a specific event attribute:
There’s a limit on how many unique values are kept on a CA. It’s limited to the first seen 100 values. When returning the list, it’s sorted alphabetically.
The following table defines the details of all supported calculations. All timestamp values are in ISO 8601 format in the UTC timezone. Several calculations produce results with types that depend on the type of the event attribute selected, for example
First Value will return a string if the event attribute selected is a string.
|Aggregation||Unique Values Count||Numeric||
||Delayed (until observed)|
||Delayed (until observed)|
|List||Unique List||Comma separated list of dynamic values; maximum of 100.||
All calculation speeds here are after the values have been initialized. Setting the date range to ‘within the last’ will cause all calculations to update with delayed speed.
Calculated attributes can be setup to calculate over defined date range. This allows you to limit calculations to a more relevant business window such as “unique list of product purchased in the last 30 days” or “total bookings made over the last year”.
The following date ranges are supported:
Some calculated attributes, like
sum, require numeric event attributes to function. If you select an attribute that is not detected as the correct type, the platform will warn you about using those fields in the calculated attribute definition. You can still use the calculated attribute despite the warning and it will attempt to convert the string values into numerics. For example, if you pass the attribute
amount in as a numeric string like
sum calculation will still work correctly: the string
"34.32" will be converted to the decimal value
Seeding allows you to pass in historic values for calculated attributes that mParticle will build upon as new data arrives, without passing in all the raw events. This allows you to seamlessly transition from your own calculations to mParticle’s. You can seed calculated attributes in both draft (recommended) and active states; the calculated attribute must exist before seeding it.
Seeding requires two pieces of information:
After seeds have been sent to mParticle, any of the following changes will make the previously received seeds invalid and subsequently deleted from mParticle.
mParticle will enrich incoming batches with active calculated attributes for that user. Just like regular user attributes, you can restrict which outputs receive them, using data filters.
There is a special feed named ‘Calculated Attributes’ that allows you to send calculated attributes downstream whenever they change, without an event from the user; this feed is especially useful for keeping calculated attributes with delayed calculations synchronized throughout your stack and for sending calculated attributes downstream alongside kit integrations. This input will appear once you have activated a calculated attribute. When a new connection is made to this input, CA values for users who have not been seen since their delayed CAs were calculated will be sent. This feed sends an update when calculated attributes change (both instant & delayed), it does not send user attributes.
Control which downstream system receives these updates by intentionally connecting specific platforms to receive the calculated attribute updates. You can also filter out calculated attributes you do not wish to forward using the platform filters page.
Calculated attributes can be used in the Audience builder by selecting User > Calculated Attributes. They will show up as ‘string’ types at first and will automatically switch to the correct type as they are computed across many users. You can build audience criteria with a calculated attribute that is calculating and when the attribute values are completed for each user, their audience membership will be updated.
To create a Calculated Attribute:
Click on the data criteria section to define the data used to run the calculation.
To adjust date range for your calculation, click on Date Range criteria.
A calculated attribute must first be activated in order for mParticle to start calculating its values across your users.
To activate a Calculated Attribute:
When activated, mParticle will start to compute and initialize the initial value for the calculated attribute. This uses both the historical data in mParticle and real-time incoming data.
Depending on the date range, volume of data in your workspace, and complexity of definition, calculations will have varying SLAs before it first becomes available across your customer profiles. Whilst calculating, the UI will display its calculation progress.
Was this page helpful?