最低百分比
Essbase 的 MDX BottomPercent 函數會傳回集合中最小的可能子集,數值評估的結果總計至少為指定的百分比。結果集會傳回從最小值到最大值的元素。
語法
BottomPercent ( set, percentage, numeric_value_expression )備註
此函數會忽略負值與遺漏值。
範例
下列查詢會傳回「基本範例」資料庫中所有產品銷售百分位數最低之 5 的產品資料。
WITH
SET [Lowest 5% products] AS
'BottomPercent (
{ [Product].members },
5,
([Measures].[Sales], [Year].[Qtr2])
)'
MEMBER
[Product].[Sum of all lowest prods] AS
'Sum ( [Lowest 5% products] )'
MEMBER [Product].[Percent that lowest sellers hold of all product sales] AS
'Sum ( [Lowest 5% products] ) / [Product] '
SELECT
{[Year].[Qtr2].children}
on columns,
{
[Lowest 5% products],
[Product].[Sum of all lowest prods],
[Product],
[Product].[Percent that lowest sellers hold of all product sales]
}
on rows
FROM Sample.Basic
WHERE ([Measures].[Sales])在 WITH 區段中,
-
具名集
[Lowest 5% products]包含那些佔第二季銷售量最低 5% 的產品。這套套裝包括 Birch Beer、Caffeine Free Cola、Strawberry、Sasparilla 和 Vanilla Cream。 -
第一個計算的成員
[Product].[Sum of all lowest prods]是用來顯示銷售在第五個百分位數最低之產品的總和。 -
第二個計算的成員
[Product].[Percent that lowest sellers hold of all product sales]是用來顯示每個月最低銷售產品的銷售與 Product 維度中所有產品的銷售比較 (以百分比表示) 的方式。
此查詢會傳回下列方格:
表格 4-41 MDX 的輸出方格範例
| (axis) | 四月 | 五 | 6 月 |
|---|---|---|---|
| 樺木啤酒 | 954 | 917 | 1051 |
| 不含咖啡因飲料 | 1049 | 1065 | 1068 |
| 草莓 | 1314 | 1332 | 1316 |
| 洋菝 | 1509 | 1552 | 1501 |
| 香草奶油 | 1493 | 1533 | 1612 |
| 所有最低產品的總和 | 6319 | 6399 | 6548 |
| 產品 | 32917 | 33674 | 35088 |
| 賣方持有所有產品銷售的最低百分比 | 0.192 | 0.194 | 0.187 |
另請參閱