calculate measure for some members that create some percent of total measure

こ雲淡風輕ζ 提交于 2019-12-12 04:32:19

问题


We have a cube that it has one measure (Commission Amount) and two dimensions customer and Date. I want calculate ratio of (count of customers who create 80 percent of Commission Amount) to (count of total customer) It is important to say that customers are sorted base on their Commission Amount How can solve this problem? And what must use to solve this query?


回答1:


You want to use the TopPercent() function here:

TopPercent(
    existing [Customer].[Customer].[Customer].Members, 
    80,  
    [Measures].[Commission Amount]  
)
/
existing [Customer].[Customer].[Customer].Members.Count



回答2:


Basically the same approach as Danylo - I just added an extra COUNT and deleted some, possibly redundant, EXISTING keywords:

DIVIDE(
  COUNT(
    TOPPERCENT(
      {[Customer].[Customer].[Customer].MEMBERS}, 
      80,  
      [Measures].[Commission Amount]  
    )
  )
  ,[Customer].[Customer].[Customer].MEMBERS.COUNT
)


来源:https://stackoverflow.com/questions/43304288/calculate-measure-for-some-members-that-create-some-percent-of-total-measure

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!