This page provides information about how to use the Interactive Query feature for the following scenario:
Data engineers want to use the free-form SQL for advanced analytics by exploring the Customer Data Platform (CDP) data model.
Data engineers can use the following tasks to navigate the data model, thoroughly explore data, create advanced queries, and refine analytics strategies to inform decision-making:
Select Use Dashboard Level Filters to apply filters across the dashboard, simplifying data analysis. From your Home Dashboard, click Add Widget to add saved queries and organize or search reports. Use Add Textbox for context or group details.
The Alert function is not intended to generate email notification reports. It is designed to notify users about the changes in monitored dataset values based on predefined criteria.
Use the following steps to create an alert:
Click Interactive Queries.
Click Create > Alert.
Search for your query.
Configure your alert using the settings panel.
Name: Enter a name for the alert.
Value Column: Select the column in your query result to monitor.
Op: Select greater than, less than, or equal to.
Reference: Enter the absolute value to compare against your Value Column. The most recent query result auto-populates as the Value.
Rearm seconds: Enter a value to set how frequently you receive notifications when your query meets the Alert criteria and remains unchanged.
For a query executing every 24 hours, setting Rearm Seconds between 1 and 86,400 results in daily notifications if the Alert status is TRIGGERED.
Click Save.
Set the notification email:
Add or remove email addresses as required.
Click Save to apply changes and receive a confirmation notification.
Navigate to the Mail Alerts page to view all your alerts.
Alert criteria Status
Details
TRIGGERED
Your query met the criteria set in your alert configuration. If your alert is configured to activate when the value of "cats" exceeds 1500, it remains triggered as long as it stays above 1500.
OK
The most recent query execution did not meet your alert's criteria. This does not imply that the alert was never triggered before. If the "cats" value is now 1470, your alert status is OK.
UNKNOWN
Redash does not have enough data to evaluate the alert criteria. You see this status immediately after creating your alert until the query executes. This status also appears if there is no data in the query result or if the most recent query result does not contain the configured Value Column.
For more information, Click ? to check the Knowledge Base.
This section explains using mastercustomerid2 in CDP to optimize queries for anonymous transactions in transactionsummary.
In the Customer Data Platform (CDP), the transactionsummary table includes mastercustomerid and mastercustomerid2 attributes.
For anonymous transactions, mastercustomerid is set to -1.
Higher numbers of anonymous customers can degrade query performance when joining transactionsummary and customersummary tables.
To improve performance, use mastercustomerid2 instead of mastercustomerid.
The mastercustomerid2 attribute is a copy of mastercustomerid, but it is NULL when mastercustomerid is -1.
For better query results, use mastercustomerid2 with a FULL OUTER JOIN to include anonymous transactions.
In queries, use mastercustomerid2 = NULL instead of mastercustomerid = "-1" in WHERE clauses to target anonymous transactions.
Sample SQL query
SELECT
customersummary.gender AS "customersummary.gender",
productsummary.brandname AS "productsummary.brand",
COUNT(DISTINCT customersummary.mastercustomerid ) AS "all_individuals_count",
COUNT(DISTINCT transactionsummary.mastercustomerid ) AS "buyer_count",
COUNT(DISTINCT transactionsummary.transactionid ) AS "transaction_count",
FROM customersummary AS customersummary
FULL OUTER JOIN transactionsummary AS transactionsummary
ON transactionsummary.mastercustomerid2 = customersummary.mastercustomerid
LEFT JOIN productsummary AS productsummary
ON transactionsummary.productid = productsummary.id
GROUP BY 1,2
ORDER BY 3 DESC
LIMIT 500
Using Interactive Queries
This page provides information about how to use the Interactive Query feature for the following scenario:
Data engineers want to use the free-form SQL for advanced analytics by exploring the Customer Data Platform (CDP) data model.
Data engineers can use the following tasks to navigate the data model, thoroughly explore data, create advanced queries, and refine analytics strategies to inform decision-making:
Select Use Dashboard Level Filters to apply filters across the dashboard, simplifying data analysis. From your Home Dashboard, click Add Widget to add saved queries and organize or search reports. Use Add Textbox for context or group details.
The Alert function is not intended to generate email notification reports. It is designed to notify users about the changes in monitored dataset values based on predefined criteria.
Use the following steps to create an alert:
Click Interactive Queries.
Click Create > Alert.
Search for your query.
Configure your alert using the settings panel.
Name: Enter a name for the alert.
Value Column: Select the column in your query result to monitor.
Op: Select greater than, less than, or equal to.
Reference: Enter the absolute value to compare against your Value Column. The most recent query result auto-populates as the Value.
Rearm seconds: Enter a value to set how frequently you receive notifications when your query meets the Alert criteria and remains unchanged.
For a query executing every 24 hours, setting Rearm Seconds between 1 and 86,400 results in daily notifications if the Alert status is TRIGGERED.
Click Save.
Set the notification email:
Add or remove email addresses as required.
Click Save to apply changes and receive a confirmation notification.
Navigate to the Mail Alerts page to view all your alerts.
Alert criteria Status
Details
TRIGGERED
Your query met the criteria set in your alert configuration. If your alert is configured to activate when the value of "cats" exceeds 1500, it remains triggered as long as it stays above 1500.
OK
The most recent query execution did not meet your alert's criteria. This does not imply that the alert was never triggered before. If the "cats" value is now 1470, your alert status is OK.
UNKNOWN
Redash does not have enough data to evaluate the alert criteria. You see this status immediately after creating your alert until the query executes. This status also appears if there is no data in the query result or if the most recent query result does not contain the configured Value Column.
For more information, Click ? to check the Knowledge Base.
This section explains using mastercustomerid2 in CDP to optimize queries for anonymous transactions in transactionsummary.
In the Customer Data Platform (CDP), the transactionsummary table includes mastercustomerid and mastercustomerid2 attributes.
For anonymous transactions, mastercustomerid is set to -1.
Higher numbers of anonymous customers can degrade query performance when joining transactionsummary and customersummary tables.
To improve performance, use mastercustomerid2 instead of mastercustomerid.
The mastercustomerid2 attribute is a copy of mastercustomerid, but it is NULL when mastercustomerid is -1.
For better query results, use mastercustomerid2 with a FULL OUTER JOIN to include anonymous transactions.
In queries, use mastercustomerid2 = NULL instead of mastercustomerid = "-1" in WHERE clauses to target anonymous transactions.
Sample SQL query
SELECT
customersummary.gender AS "customersummary.gender",
productsummary.brandname AS "productsummary.brand",
COUNT(DISTINCT customersummary.mastercustomerid ) AS "all_individuals_count",
COUNT(DISTINCT transactionsummary.mastercustomerid ) AS "buyer_count",
COUNT(DISTINCT transactionsummary.transactionid ) AS "transaction_count",
FROM customersummary AS customersummary
FULL OUTER JOIN transactionsummary AS transactionsummary
ON transactionsummary.mastercustomerid2 = customersummary.mastercustomerid
LEFT JOIN productsummary AS productsummary
ON transactionsummary.productid = productsummary.id
GROUP BY 1,2
ORDER BY 3 DESC
LIMIT 500
Click the alert name to edit alerts.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Click the alert name to edit alerts.
Did not find what you were looking for?
If this content did not answer your questions, try searching or contacting our support team for further assistance.