Computations
How to build and enable user-based aggregates and expressions
The Computations page allows clients to list and manage computations set from Data Engine for that project. A computation is described as a 'Question’ on the Data Engine side, helping users gather answers on computed attributes.
In order to have computed attributes (aggregates) on a Xtremepush project and use them in segmentation, a computation should be created first.
Create a computation/question
To create a question, navigate to Intelligence > Data Engine > New > Question. Any type of question such as a simple query, custom query or SQL query can be created.
Include one or more columns, each representing a single computed attribute. The names of these columns will be used as the attribute names.
Required identifiers
For these types of questions, a User ID, profile ID or a profile UID column should be included.
Also, at least one attribute column must exist as well.
Use Profile UID column in the question
Profile UID is a unique identifier of a user profile in Xtremepush. It’s recommended to add this identifier to questions for performance reasons. If you want your question to be computed in real time it’s a required field
Here is an example of a question that can be used to compute attributes:
user_id | total_deposits | avg_deposit_amount | last_deposit_date |
---|---|---|---|
12345678 | 5 | 120.00 | 2022-10-01 12:00:00 |
These documents may help to learn more about question creation.
-
An introduction to a graphical query builder.
-
Custom expressions are tools you can use in the graphical query builder to ask more complex questions.
-
A list of the aggregations and functions available in the graphical query builder.
-
An introduction to an SQL query editor for complex questions that can't be expressed using the query builder.
All the questions used for the attributes' computations should be saved to Collection > Computed Attributes > Staged Computations.
Manage the computations
Activate Computation
After creating a question on the Data Engine, it will appear as a new computation on the computation list. Navigate to Intelligence > Computations, click on the Options menu on the right of the computation > Activate, which will open a modal listing the new attributes that will be created.
![Xtremepush query builder](https://files.readme.io/219e359-computations-list.png)
Activating a computation
In the modal:
- Check the name of the attributes and their types.
- Select the computation frequency:
- For most of the questions, the Realtime option should be available.
- For questions that are not optimised for realtime computing select whether you want to compute them Hourly or Daily.
- Click onActivate.
![Xtremepush query builder](https://files.readme.io/a3cb433-activate-dialog.png)
Real-time computations become available immediately after activation. Scheduled computations may take some time to compute before they become available.
Computed attributes are unique
A computed attribute will not be created again through a different computation, as it has already been created in the project.
Using Computed Attributes
Once your computation is activated the data is populated as computed attributes. The computed attributes will automatically be created and show up in Data > Data Manager > Computed Attributes.
From the computation, once the computed attribute matches with the profile_id
or user_id
, that computed attribute will be assigned to the profile.
Assigned computed attributes on a profile can be found in the Data > Computed Attributes section of a user profile
Deactivating and editing a computation
A computation can be deactivated if it is required. It will delete all linked computed attributes.
Editing
In order to edit an activated computation:
- Deactivate the computation from Intelligence > Computations.
- Click on the Options menu on the right of the computation > Settings.
- Make changes to the question and save the new version.
- Activate the computation back from Intelligence > Computations page.
![Promo amount](https://files.readme.io/0ba640c-computations-list-active.png)
Deleting
The computation can be deleted by clicking on the Options menu on the right of the computation > Deactivate.
Updated 2 months ago