Returns the smallest possible subset of a set for which the total results of a numeric evaluation are at least a given percentage. Elements in the result set are listed from largest to smallest.
TopPercent ( set, percentage, numeric_value_expression )
| set | The set from which to select the top-percentile elements. |
| percentage | The percentile. This argument must be a value between 0 and 100. |
| numeric_value_expression | The expression that defines the selection criteria. |
This function ignores negative and missing values.
The following query selects the top-selling markets that contribute 25% of the total yearly Diet products sales, and displays the quarterly sales for each Diet product.
SELECT
CrossJoin(
[Product].[Diet].Children,
[Year].Children
)
ON COLUMNS,
TopPercent(
[Market].Levels(0).Members,
25,
[Product].[Diet]
)
ON ROWS
FROM Sample.Basic
WHERE ([Scenario].[Actual],
[Measures].[Sales])
This query returns the grid:
| 100-20 | 200-20 | 300-30 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Qtr1 | Qtr2 | Qtr3 | Qtr4 | Qtr1 | Qtr2 | Qtr3 | Qtr4 | Qtr1 | Qtr2 | Qtr3 | Qtr4 | |
| Illinois | 755 | 958 | 1050 | 888 | 1391 | 1520 | 1562 | 1402 | 675 | 755 | 859 | 894 |
| California | 367 | 491 | 506 | 468 | 1658 | 1833 | 1954 | 1706 | 700 | 802 | 880 | 673 |
| Colorado | 700 | 802 | 880 | 673 | 549 | 465 | 412 | 539 | 1006 | 921 | 892 | 991 |
| ©2004 Hyperion Solutions Corporation. All Rights Reserved. http://www.hyperion.com |