Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Sherry Li's BI Corner

Always wanting to publish novels, but having the fortune to work in the data warehouse corner of technology, Sherry Li started to write the mysteries of the Microsoft Business Intelligence. She writes everything from T-SQL to MDX, ETL to Expressions to Scripting, Reporting to Cubes. You can find her writings at bisherryli.wordpress.com.

MDX #20 – Last Data Date

Need to check the last time when our ETL processes ran successfully

Data warehouse developers routinely query the last data date (the last date when we have fact data) to check the last time when our ETL processes ran successfully.

It’s not hard to do it in TSQL. It just requirements a bit of typing. In this example, I am showing the last data date in its readable format and the Sales Amount on that day.

clip_image001

A lot easier to do this in MDX

It’s actually a lot easier to do this in MDX. With the help of the TAIL() function and the NONEMPTY() function, the last data date is easy to query without any sub-queries or calculations.

clip_image002

Always verify

To make sure we got it right, run this simple query to verify.

clip_image003

Note: There is no need to order by the Date dimension. It’s already ordered in the SSAS.


Comments

Leave a comment on the original post [bisherryli.com, opens in a new window]

Loading comments...