내 큐브에는
MIN
집계 를 통한 측정 기준으로 수익내 질문은 다음과 같습니다.
What are the minimum earnings of the person who decides to buy
apartments in the city center, excluding 5% of the lowest, within
last 2 years?
이제 내 mdx 쿼리는 다음과 같습니다.
SELECT
[Measures].[MinEarnings] ON COLUMNS
FROM [cube]
WHERE
(
BottomCount ([Localization].[Type].&[center], 95, [Measures].[MinEarnings]),
{[Date].[Year].&[2017], [Date].[Year].&[2018]}
)
두 가지 문제가 있습니다.
우선 bottomcount가 아닌 toppercent를 사용해야합니다. 마지막 5 %가 아닌 사람의 최저 급여를 원합니다. Toppercent는 상위 95 %를 제공합니다.
둘째로 0을 필터링하려면 다음 구문을 사용할 수 있습니다.
toppercent (
filter([Localization].[Type].&[center], [Measures].[MinEarnings]>0)
, 95, [Measures].[MinEarnings])
지금도 where 절에 코드를 배치해도 작동하지 않을 수 있지만 시도해보십시오. 나는 당신이 toppercent를 행으로 옮긴 다음 주문한 다음 top1을 가져가는 것이 좋습니다.
topcount(
order(
toppercent (
filter([Localization].[Type].&[center], [Measures].[MinEarnings]>0)
,95, [Measures].[MinEarnings])
,[Measures].[MinEarnings],asc)
,1)
도시의 최소 판매량을 제공하는 예가 있습니다. 가능한 한 귀하의 경우에 가깝게 만들기 위해 null을 0으로 대체했습니다.
멤버 [Measures]. [Internet Sales Amount2] ([Measures]. [Internet Sales Amount]) = null then 0 else [Measures]. [Internet Sales Amount] end
select [Measures].[Internet Sales Amount2]
on columns ,
topcount(order(toppercent(filter([Customer].[City].[City],[Measures].[Internet Sales Amount2]>0),95,[Measures].[Internet Sales Amount2]),[Measures].[Internet Sales Amount2],asc),1)
on rows
from [Adventure Works]
where [Customer].[Country].&[Canada]
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다