简体   繁体   中英

to select top MAX 10 measure in mdx

I am trying to select top max 10 measure in MDX and I get this,what I have to do to get top 10 max.

     With
    Set [Top10] AS
    (TOPCOUNT({ORDER( ({[Customer].[Customer State]})
     ,([Measures].[Customers Quantity]),BDESC)},10))
    Select
    [Measures].[Customers Quantity] on Columns,
    {[Top10]}  on Rows
    From
    [DW Brazillian Ecommerce]

and I get this

在此处输入图像描述

I know what I did is wrong so what is the accurate query to get top 10 max customer quantity??

Change [Customer].[Customer State] to [Customer].[Customer State].[Customer State].Members . In the current expression you are just ranking the grand total. This change fixes the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM