问题
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