0

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
renegm
  • 610
  • 2
  • 5
  • 12

1 Answers1

0

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
  • 2,628
  • 15
  • 14