Blog Post

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.

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating