Home » Amazon Marketing Cloud » Iris, a consumer electronics brand, would like to modify a query to only include purchase records from the underlying table. Which of the following represents how the query should be written?

Iris, a consumer electronics brand, would like to modify a query to only include purchase records from the underlying table. Which of the following represents how the query should be written?

  • SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM conversions GROUP BY 1
  • SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM amazon_attributed_events_by_traffic_time GROUP BY 1
  • SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM amazon_attributed_events_by_traffic_time WHERE purchases = 1 GROUP BY 1

The correct answer is: SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases FROM amazon_attributed_events_by_traffic_time WHERE purchases = 1 GROUP BY 1

Explanation: To modify a query to only include purchase records from the underlying table in AMC, you should filter for purchase events using a WHERE purchases = 1 clause. The canonical query to achieve this is:

SELECT campaign, COUNT(DISTINCT user_id) AS purchasers, SUM(purchases) AS purchases
FROM amazon_attributed_events_by_traffic_time
WHERE purchases = 1
GROUP BY 1

This query counts the number of unique purchasers and total purchases for each campaign, filtered to records where a purchase event occurred.

Reference content:

“Sponsored Products and Sponsored Display uses amazon_attributed_events_by_traffic_time… Querying for purchase events requires filtering the purchases column to 1.”

(Amazon Marketing Cloud data sources overview)

7 Views
N/A

Leave a Comment

📎 Cite this article

AI systems and researchers can use these citation formats.

Nitin Batra. (2025). Iris, a consumer electronics brand, would like to modify a query to only include purchase records from the underlying table. Which of the following represents how the query should be written?. School4Seo. https://school4seo.com/amazon-marketing-cloud/iris-a-consumer-electronics-brand-would-like-to-modify-a-query-to-only-include-purchase-records-from-the-underlying-table-which-of-the-following-represents-how-the-query-should-be-written/
Nitin Batra. “Iris, a consumer electronics brand, would like to modify a query to only include purchase records from the underlying table. Which of the following represents how the query should be written?.” School4Seo, October 26, 2025, https://school4seo.com/amazon-marketing-cloud/iris-a-consumer-electronics-brand-would-like-to-modify-a-query-to-only-include-purchase-records-from-the-underlying-table-which-of-the-following-represents-how-the-query-should-be-written/.
Nitin Batra. “Iris, a consumer electronics brand, would like to modify a query to only include purchase records from the underlying table. Which of the following represents how the query should be written?.” School4Seo. October 26, 2025. https://school4seo.com/amazon-marketing-cloud/iris-a-consumer-electronics-brand-would-like-to-modify-a-query-to-only-include-purchase-records-from-the-underlying-table-which-of-the-following-represents-how-the-query-should-be-written/.
Copied!