Hi All,
I've done my best to crack this one but being a beginner i'm at my wits end.
I'm using an AnalysisServices OLAP cube and i'm trying to cross join and return a set that contains only the first and last tuples in the set [Shift Log] and for each member in the [Source] set that contained any value in [Dim Measures].[Measure].[Loader
Buckets]
I've found the code to determine the last tuple (below) which works well, but i cannot work out how to get the first tuple [Dim Shift Log].[Shift Log] for each [Dim Sources].[Source] for the [Dim Measures].[Measure].[Loader Buckets] variable.
I've tried using the HEAD function but all i can seem to return is the first [Shift Log] or the first [Source] but never the first [Shift Log] for each [Source] using the [Loader Buckets] Measure.
Apologies if this is poorly explained.
WITH SET BOGFINISH AS FILTER
(
NONEMPTY(
[Dim Sources].[Source].CHILDREN
* [Dim Shift Log].[Shift Log].CHILDREN ) AS MYSET //THIS DETERMINES THE INITIAL SET OF TUPLES
, NOT(MYSET.CURRENT.ITEM(0)
IS MYSET.ITEM(RANK(MYSET.CURRENT, MYSET)).ITEM(0) )
) // THIS PICKS THE LAST TUPLE FOR EACH MEMBER
SELECT
[Dim Measures].[Measures].[Loader Buckets] ON COLUMNS, //THIS ARE THE ROWS (ATTRIBUTES)
BOGFINISH ON ROWS //THIS ARE THE ROWS (ATTRIBUTES)
FROM DOMECube
WHERE [Dim Shift Log].[Period Year].&[2019]*{[Dim Sources].[Source Loc Type].&[DHS],[Dim Sources].[Source Loc Type].&[UHS]}*[Dim Measures].[Measure].[Loader Buckets]