I have small doubt in ssas cube datasource view level.
I want add one new column(last100days) in Dimdate timension and that column show last 100 days information.
I Tried in sql server level like below query
add new column(last100days) in dimdate dimension
1)update dimdate set last100days='01-01-1900'
2)update dimdate
set last100days=[StandardDate]
WHERE [StandardDate] >= DATEADD(day,-100, getdate())
and [StandardDate] <= getdate()
That time i will get accurate result in dimdate dimension. same way I tried In datasoure view level in dimdatedimension level right click on that and choose new namedcalculation and I give column name is last100days and enter expression like [StandardDate] >= DATEADD(day,-100, getdate()) and [StandardDate] <= getdate() that time it show error like below
TITLE: Microsoft Visual Studio
Deferred prepare could not be completed. Statement(s) could not be prepared. Incorrect syntax near the keyword 'AS'. Incorrect syntax near the keyword 'update'.
BUTTONS:
OK..I
-
-
enter code here
add new column and that column have from today to last100 days dates .please help me how to resolve this issuse in ssas cube side
You need to enter an expression that returns a value. All yours does is test conditions.
Try this instead: