views:

19

answers:

1

I have a cube with several dimensions. I need (a measure, calculation, whatever...) to show last value of a column, assuming the table is sorted by another column.

Something like:

SELECT TOP 1 column_1
FROM table_1 
WHERE «The user's selected dimentions will work as a filter»
ORDER BY column_2 DESC
A: 

You would possibly use something like

WITH Measures.[Top 1] AS
     TopCount([Dimension1Name].[Attribute1Name].[Level1Name].Members, 1, [Dimension2Name].[Attribute2Name].[Level2Name].Members)
SELECT Measures.[Top 1] ON COLUMNS
  FROM [CubeName]

where the names with 1 refer to your column_1, and those with 2 to your column_2.

Frank