Setup
Last updated
Was this helpful?
Last updated
Was this helpful?
Check the . Bellow are some precisions about specific Computed fields Function implementation.
These 3 functions are triggered during the initialization of the Computed Field Function and whenever a new activity, profile update, or computed field modification occurs, updating the State
accordingly.
.
Although onUpdateComputedField
has not been released yet, it is still required to be implemented in your plugin. In the meantime, simply return the State
directly to avoid any errors.
This function returns the result of the computed field function for a specific State
. The Result
will be stored for a defined duration, and querying the field will return the stored value during that period.
In the Navigator > Settings > Datamart, navigate to Computed Fields.
Add a new computed field.
Select the plugin and version of the new instance you want to use.
Complete the necessary fields:
Name
Name of the computed field
Description
(Optional) Describe the computed field
Technical name
Name of the computed field used in the schema
Compute period (in days)
Maximal duration before the periodic update of the Result
in days.
Events filter
GraphQL selector query to filter the activity which will trigger the State
updates
This will set up the computed field linked to your computedfield function for use in the schema.
After creating the computed field, you need to connect it to your schema:
Use the directive @ComputedField(technical_name = "...")
at the appropriate level of your schema.
Ensure the technical name matches the one used when creating the computed field.
This will integrate the computed field into your schema and make it available for use in queries and operations.
A schema validation will be triggered when you click Save. It will ensure that your Datamart has access to all the declared computed fields and verify their integration with the schema.
The computed field must be in the UserPoint object.
Once your schema is validated, our service will run a job to initialize your computed field and set the state to match the current status of the timeline. For each user point in your Datamart, we will process their timeline and execute the OnUpdateXXX() function.
To monitor the progress:
Go to the Computing Console > Computed Fields.
Check if your computed field is ready or if the initial loading is still in progress.
Please note, this process may take some time to complete (up to 72h) as it computes the timelines for all user points.
Avoid using your computed field until the initial loading is complete. While the query will not return an error, the result may be inaccurate during this process.
Once the initial loading is complete, you can start using your computed field just like any other standard field in mediarithmics features.
For example, in query tools or any OTQL query:
If your computed field is indexed, you can also perform queries like:
This allows you to incorporate the computed field into your data analysis and queries once it's fully initialized.
.
Follow the standard procedure to with the type COMPUTED_FIELD_FUNCTION
. Once the plugin is created, you can from the build.