Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

MDX help - Replace Rank function

$
0
0

Hi All

In one of our mdx query we have Displaylevel member which will display 1 or 2 based on the latest and old Datetime values. In Myset we will get last 145 values and we are rating latest 13 values as 2 and remaining 132 values as 1  so that all 2 display value will be displaed for every 5 minutes and 1's will display in hourly bases . Here everything is working fine . But some times we are getting Memorydumps . so we plan to change Rank function.

My question here is how can we achieve this displaylevel logic without RANK function

Logic Should be :  Rank 145 samples in Myset named SET based on Date and time values ( not based on any measure) Thats all

with        SET [LastDate] AS TAIL(NONEMPTY([Date].[Year -  Month -  Date].[Date].Members, [Measures].[MSR Sessions Count]), 1)
       SET LastSample AS TAIL(NONEMPTY([Time].[Time Hierarchy].[Twelfth Of Hour].Members, [Measures].[MSR Sessions Count]*[LastDate]), 1)
       SET MySet AS TAIL({([LastDate].ITEM(0).PREVMEMBER, LastSample.ITEM(0):[Time].[Time Hierarchy].[Twelfth Of Hour].&[23:55]),
              ([LastDate].ITEM(0), [Time].[Time Hierarchy].[Twelfth Of Hour].&[00:00]:LastSample.ITEM(0))}, 145)
       MEMBER DisplayLevel AS IIF(RANK(([Date].[Year -  Month -  Date],[Time].[Time Hierarchy]),MySet) > 132,2,1)


Surendra Thota



Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>