Tuesday, November 15, 2011

Cube Data Testing

If it’s a new development of a Cube, Browse the Cube, drag and drop measures on the Page and Dimension on the Y-axis. You need to write T-SQL that does similar aggregation that brings similar output.

Eg:

OWC Output:

SALES PROFIT

AP

CHINA 200 60

INDIA 250 50

US

CHICAGO 500 65

WASHINGTON 550 65

Equivalent T-SQL:

SELECT REGION, CITY, SUM(SALES ), SUM(PROFIT) FROM GEOG G JOIN SALES S FACT ON G.ID=S.ID

GROUP BY REGION, CITY ORDER BY 2

No comments:

Post a Comment