Code Editor

Query Results

Run a query to see results.

Database Schema

Schema undefined.
Advanced Aggregates

Product Sum 2

Great! We have the sum of the the products by revenue, but we still need the percent. For that, we'll need to get the total using a subquery. A subquery can perform complicated calculations and create filtered or aggregate tables on the fly.

Subqueries are useful when you want to perform an aggregation outside the context of the current query. This will let us calculate the overall total and per-item total at the same time.

Report a Bug
If you see a bug or any other issue with this page, please report it here.