Last Nonempty Date/ Last Transaction Date

I freqeuntly got question on to get last non empty date or last date when transaction happened.

Here we will look at two example on how to get it from Adventure Works cube



SELECT
[Measures].[Internet Sales Amount] ON 0
,Tail
(
Filter
(
[Date].[Date].MEMBERS
,(NOT
IsEmpty([Measures].[Internet Sales Amount]))
)
,1
) ON 1
FROM [Adventure Works];



SELECT
[Measures].[Internet Sales Amount] ON 0
,Tail
(
NonEmpty
(
[Date].[Date].MEMBERS
,[Measures].[Internet Sales Amount]
)
,1
) ON 1
FROM [Adventure Works];

Cheers
Amish Shah

No comments:

Post a Comment

Amazon Contextual Product Ads

Popular Posts