BTS Snippets
Splitting Aggregates
One block per day (using Block Aggregate)
One block per session_id (using Block Aggregate)
Inactivity based split (using Activity Aggregate)
Advanced BTS functions
Parsing UNIX timestamp
Parsing ISO datetime string
Create a map
Merge 2 strings with comma separated values in source data to create a list of tuples
Data cleansing
Create a boolean value from a condition on a text field in raw data
Convert strings in raw data to a float
If the raw data has a field "txn_amount": "9.99"
, which is a float but formatted as a string, it can be converted to a float to perform operations in a field value
Flatten a list of list of tuples
Data validation
Determine correctness of a Block Aggregate
One possible way of determining the correctness of a Block Aggregate (like a user session, for example), without relying on the order of events could be done with:
Then another field can be defined to determine the correctness:
valid_start_and_end
is defined as a custom function.
As more events are processed the value of session_stats.valid_session will maintain whether this session is valid or not. The fields are evaluated in the order they are defined so the valid_session field should be defined after game_start_and_end field.
Per event validation
Some ways to validate individual events for things like missing field values, reuse fields etc are:
Create a variable (
Variable Aggregate
) with the required clean up on the event fieldUse
When
inField
for validation conditionsDefine a
valid_event
field and use that in When. This can be go inVariable Aggregate
if we don't want to save itIf it is ok to ignore fields that have errors (e.g. missing), Blurr does not process the event and drops it as default behavior. If the source is missing event fields, the
Field evaluation
is skipped and an error is logged in debug logs.
Last updated