File tree Expand file tree Collapse file tree 1 file changed +1
-40
lines changed
Expand file tree Collapse file tree 1 file changed +1
-40
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ Yardstick adds **measure-aware SQL** to DuckDB. Measures are aggregations that k
1010- ** Year-over-year comparisons** with simple syntax
1111- ** Drill-down analytics** that automatically adjust aggregation context
1212
13- ## Quick Start
13+ ## Quick Start & Demo
1414
1515``` sql
1616-- Load the extension
@@ -139,45 +139,6 @@ GROUP BY dimensions;
139139| ` AT (WHERE cond) ` | Pre-aggregation filter | ` AGGREGATE(revenue) AT (WHERE region = 'US') ` |
140140| ` AT (VISIBLE) ` | Use query's WHERE clause | ` AGGREGATE(revenue) AT (VISIBLE) ` |
141141
142- ## Examples
143-
144- ### Percent of Total
145-
146- ``` sql
147- SEMANTIC SELECT
148- region,
149- AGGREGATE(revenue) AS revenue,
150- 100 .0 * AGGREGATE(revenue) / AGGREGATE(revenue) AT (ALL) AS pct_total
151- FROM sales_v
152- GROUP BY region;
153- ```
154-
155- ### Year-over-Year Growth
156-
157- ``` sql
158- SEMANTIC SELECT
159- year,
160- AGGREGATE(revenue) AS revenue,
161- AGGREGATE(revenue) AT (SET year = year - 1 ) AS prior_year,
162- 100 .0 * (AGGREGATE(revenue) - AGGREGATE(revenue) AT (SET year = year - 1 ))
163- / AGGREGATE(revenue) AT (SET year = year - 1 ) AS yoy_growth
164- FROM sales_v
165- GROUP BY year;
166- ```
167-
168- ### Contribution to Parent
169-
170- ``` sql
171- SEMANTIC SELECT
172- year,
173- region,
174- AGGREGATE(revenue) AS revenue,
175- AGGREGATE(revenue) AT (ALL region) AS year_total,
176- 100 .0 * AGGREGATE(revenue) / AGGREGATE(revenue) AT (ALL region) AS contribution
177- FROM sales_v
178- GROUP BY year, region;
179- ```
180-
181142## Building
182143
183144Prerequisites:
You can’t perform that action at this time.
0 commit comments