Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions test/sql/measures.test
Original file line number Diff line number Diff line change
Expand Up @@ -1772,6 +1772,49 @@ WHERE year = 2023;
----
150.0

# ORDER BY with named aggregate that expands to a subquery (GH #28)
query IIRR
SEMANTIC SELECT
year,
region,
AGGREGATE(revenue) AS revenue,
AGGREGATE(revenue) AT (ALL region) AS year_total
FROM sales_v
ORDER BY revenue/year_total, year, region;
----
2022 EU 50.0 150.0
2023 EU 75.0 225.0
2022 US 100.0 150.0
2023 US 150.0 225.0

# ORDER BY with simple alias of subquery expression (GH #28)
query IIR
SEMANTIC SELECT
year,
region,
AGGREGATE(revenue) AT (ALL region) AS year_total
FROM sales_v
ORDER BY year_total, year, region;
----
2022 EU 150.0
2022 US 150.0
2023 EU 225.0
2023 US 225.0

# ORDER BY DESC with subquery alias (GH #28)
query IIR
SEMANTIC SELECT
year,
region,
AGGREGATE(revenue) AT (ALL region) AS year_total
FROM sales_v
ORDER BY year_total DESC, year, region;
----
2023 EU 225.0
2023 US 225.0
2022 EU 150.0
2022 US 150.0

# =============================================================================
# Test: Expression dimensions (issue #29)
# =============================================================================
Expand Down
Loading
Loading