ePrivacy and GPDR Cookie Consent by Cookie Consent Skip to main content

Context queries setup

Entities setup is usually done by the Meiro technical consultant. 

In the Administration/Entities/Context queries tab, setting context queries that will be used through Meiro Business Explorer is possible.

What is it?

Context query behaves as a key-value storage holding results that are conducted across the entire customer base. This context table allows for extracting and storing attributes related to customer profiles, such as engagement attributes.

The purpose of the Context Query is to provide a centralized repository for storing and retrieving relevant customer data across multiple use cases. By maintaining a context table, analysts can efficiently access pre-computed customer attributes without having to re-run complex queries every time the data is needed. 

Some example use cases for the Context Query include:

  • Tracking customer engagement metrics like purchase frequency, average order value, or product affinities of a profile relative to other profiles in the entire customer base.
  • Group customer profiles into different buckets by comparing them with the entire customer base, for example, with RFM (Recency, Frequency, Monetary) analysis.

The context table is designed to be a flexible and scalable storage that can accommodate a wide range of customer data points. 

Learn more: about context queries and examples of usage here.

Context queries list


Unique identifier of context query


Short description of the purpose of the context query

Last run

indicates the timestamp of when each context query was last executed. 


If the query has been executed at least once, the "Last run" column will display the datetime of the last execution and the value of the query, otherwise a dash symbol will be visible to each of them. 

Recalculation of queries occurs once per day. 

Modified at

indicates when each context query was last modified.

SQL preview

To streamline this process and examine context-queries attributes rapidly, use the SQL preview on the list.


Edit the description of the SQL query of the context query

Create Context queries

To create a context query, click the ‘Create’ button and complete the form.


Context query key

(required, not editable later)

Insert a unique identifier of the context query. It can not be the same as any other ID of an attribute, meta attribute, or context query.




An optional field to draw a description of a context query. The context query and its descriptions will be visible within the context queries list.


The definition of a context query indicates the query you want to have available as a Common Table Expression (CTE). 

SQL query


The custom option allows managing attribute definition through an SQL query.

Remember: The value resulting from the context query must be a string and stored in a single column named 'value.'