Anyone see a problem with creating this view for a cube??
The error I get seems to be in line 8 with the sum function, but I see nothing wrong with it.
CREATE VIEW CarCube AS
SELECT CASE WHEN (GROUPING(CarType) = 1) THEN 'ALL'
ELSE ISNULL(CarType, 'Not Known')
END AS CarType,
CASE WHEN (GROUPING(Color) = 1) THEN 'ALL'
ELSE ISNULL(Color, 'Not Known')
END AS Color
SUM(Amount) AS TotalAmt
GROUP BY CarType, Color WITH CUBE