This page provides information about how to use the Interactive Query feature for the following scenario:
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:
No | Steps | Description |
---|---|---|
1 | Sign in to Acquia CDP | Sign in to the CDP user interface |
2 | Create queries | |
3 | Create a dashboard | |
4 | Create an alert | Creating an alert |
5 | Ways to improve query performance | Improve query performance |
To create a query:
Click Create > Query.
Enter a name for your query.
CDP lists the tables and fields on the left and provides a query command line on the right for SQL commands.
To create a basic query, use the following SQL command:
The two approaches to query the data are:
Selecting from tables:
Click the Customer table from the list to view its fields.
Locate and hover over the email field, and then click the forward (>>) icon to add to the query.
Repeat steps a through c for additional fields.
Direct command-line entry:
Type field names directly in the command line.
Use auto-fill for suggestions.
Add SQL lines like AND email = '[email protected]'
for refinement.
Use the following options to execute your queries:
Use the following steps to troubleshoot your queries:
Use the following steps to add and customize visualizations:
Click Execute to run the query.
CDP displays the selected fields and their values based on the query execution. By default, visualization is displayed in a table view.
Click + New Visualization to create various visualizations using the Visualization Type, based on query results.
Click Save.
CDP adds a new table beside your default table visualization.
Click Editing Visualization to modify a visualization tab.
Click the ellipsis menu to access additional features:
Add to Dashboard: Add it directly to a Dashboard.
Embed Elsewhere: Embed the visual in another query.
Download as CSV File: Download and export as a CSV file.
Download as Excel File: Download and export as an Excel file.
Use the following steps to set up a refresh schedule:
For Refresh Schedule, click Never.
Select an option from Refresh Every to schedule updates hourly, daily, or weekly.
Set On-time by selecting the required execution time.
For more information, click ? to access the Knowledge Base.
Use the following steps to create a dashboard:
Enter a name for your dashboard.
Click Save.
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.
Use the following steps to add text boxes:
Click Add Textbox.
Name the reporting session and add a list of query reports.
For example, Report 1.
Refer to the Support Markdown for guidance to style your text using Basic Syntax or Extended Syntax.
Type in the textbox to see a preview in the Preview section.
Click Add to Dashboard to save.
Use the following steps to add widgets:
Click Add Widget.
Search for your query.
Choose a visualization from the available query report options, such as Table (default).
Click Add to Dashboard.
Click Done Editing.
Use the following steps to manage dashboard functions:
Click the ellipsis menu to:
Edit: Edit the dashboard.
Archive: Archive the dashboard.
To set a refresh schedule, click the arrow and choose from the dropdown options:
12 hours: Recurring refresh every 12 hours
1 day: Daily recurring refresh
Click Publish to share the dashboard or make it visible to others.
For more information, click the Help (?) icon to check the Knowledge Base.
Use the following steps to create an alert:
Search for your query.
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.
Click the alert name to edit alerts.
Alert criteria Status | Details |
---|---|
| 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. |
| 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. |
| 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
.
transactionsummary
table includes mastercustomerid
and mastercustomerid2
attributes.mastercustomerid
is set to -1
.transactionsummary
and customersummary
tables.mastercustomerid2
instead of mastercustomerid
.mastercustomerid2
attribute is a copy of mastercustomerid
, but it is NULL
when mastercustomerid
is -1
.mastercustomerid2
with a FULL OUTER JOIN to include anonymous transactions.mastercustomerid2 = NULL
instead of mastercustomerid = "-1"
in WHERE clauses to target anonymous transactions.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
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Tue Nov 26 2024 14:36:18 GMT+0000 (Coordinated Universal Time)