

This behavior does not affect the DMX functions. The MDX functions for TOPPERCENT and BOTTOMPERCENT can generate unexpected results when the values used to calculate the percentage include negative numbers. Depending on the size of your data set, this query might take a long time to run.

Note This example is provided only to illustrate the usage of TopPercent.

To get the rows for the top products that sum to 50 percent of the total support, you type 50. The third argument to the TopPercent function specifies the percentage, as a double. This example uses $SUPPORT because support values are not fractional and therefore are easier to verify. In this example, the INCLUDE_STATISTICS option returns the columns $SUPPORT, $PROBABILTY, and $ADJUSTED PROBABILITY. The second argument to the TopPercent function is the column in the nested table that you use to order the results. In this example, the nested table is returned by calling the Predict function and using the INCLUDE_STATISTICS argument.

The first argument to the TopPercent function is the name of a table column. (SELECT (SELECT 'Women''s Mountain Shorts' as ) AS ) AS t The TopPercent function takes the results of this query and returns the rows with the greatest values that sum to the specified percentage. For more information, see Create a Singleton Query in the Data Mining Designer. When you select the value from the dropdown list, the required escape character is inserted for you. If you are not sure of the syntax for inserting an escape character, you can use the Prediction Query Builder to create the query. In this example, the value supplied as input contains a single quotation mark, and therefore must be escaped by prefacing it with another single quotation mark. SELECT (SELECT 'Women''s Mountain Shorts' as ) AS ) AS t SELECT Predict (., INCLUDE_STATISTICS, 10)
