SSAS: Create a Calculated Measure always getting the value for "Yesterday"
If you want to create a calculated measure in SSAS (SQL Server Analysis Services) that will always get the value for yesterday, this is what I have come up with:
CREATE MEMBER CURRENTCUBE.[MEASURES].[My Yesterday Measure] AS (StrToMember(’[Time].[Calendar Date].&['+ VBA!Format(vba!dateadd("d", -1, vba![date]()),’yyyy-MM-dd’) +’T00:00:00]’),[Measures].[My Cool Value]), FORMAT_STRING = “$#,##0.000″, VISIBLE = 1 ;
What is really cool is you can [...]
Leave a Comment | 310 views
