Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions test/sql/measures.test
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,36 @@ SEMANTIC SELECT year, region, AGGREGATE(revenue) FROM sales_v;
2023 EU 75.0
2023 US 150.0

# =============================================================================
# Test: CTE with AGGREGATE
# =============================================================================

query IIR rowsort
SEMANTIC WITH a AS (
SELECT year, region, AGGREGATE(revenue) AS revenue
FROM sales_v
)
SELECT * FROM a;
----
2022 EU 50.0
2022 US 100.0
2023 EU 75.0
2023 US 150.0

# =============================================================================
# Test: GROUP BY with extra spaces
# =============================================================================

query IIR rowsort
SEMANTIC SELECT year, region, AGGREGATE(revenue) AT (ALL region) AS year_total
FROM sales_v
GROUP BY year, region;
----
2022 EU 150.0
2022 US 150.0
2023 EU 225.0
2023 US 225.0

# =============================================================================
# Test: AT (ALL dimension) - remove dimension from context
# =============================================================================
Expand Down
Loading
Loading