All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Query |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

*** This class is subject to change. ***

## com.sas.iquery.metadata.business.step.olap
Class DataItemRankFilter

    com.sas.iquery.metadata.business.step.olap.DataItemRankFilter

All Implemented Interfaces:
  Base, BusinessModelResourceReferencer, ModelItem, StepFilterInterface, StepInterface, UsabilityInterface, PropertyChangeListenee, com.sas.util.LocalizableToStringInterface, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

    public class DataItemRankFilter

A step that ranks a data item based on a ranking criteria. The type of ranking that can be applied: TopCount, TopPercent, TopSum, BottomCount, BottomPercent, and BottomSum.

TopCount/BottomCount- select the top/bottom N tuples (based on the value in the `byRankQualifierNames` list) of an axis or the crossing of the dimensions (categories) selected for an axis. The TopCount return elements order from largest to smallest in terms of the measure used (if specified). The BottomCount returns them ordered from smallest to largest.

TopPercent/BottomPercent - selects the top/bottom tuples (based on the value in the `byRankQualifierNames` list)of an axis corresponding to the top/bottom N% of all tuples in that axis.

TopSum/BottomSum - selects the top/bottom tuples (based on the value in the `byRankQualifierNames` list)of an axis whose sum meets a N threshold.

The numeric constant gives the number of tuples to tak and it returns up to that many from the axis, in order from the largest to the smallest.

The optional value applied in the `byRankQualifierNames` list is typically an expression of cell coordinates that returns a number or a measure such as SALES_SUM.

If a numeric expression is specified, the function sorts, in descending order, the tuples for the axis specified according to the value specified by the numeric expression, as evaluated over the specified set. After sorting the set, the function then returns the specified number of tuples (as applied by the numeric constant) with the highest value.

If no value is applied in the `byRankQualifierNames`, then the value used is the current member along the Measure dimension during an iteration.

Let us look at a simple example of how to use TopCount:

A user might request to see the top 10 products based on the value of SALES_SUM. In this case, Products is actually the data item that is being ranked. The SALES_SUM is a qualifier that helps to define the ranking operation.

If SALES_SUM specified, in this case the default MEASURE applied to the cube (ACTUAL_SUM) would be used.

See Also:
  `StepFilterInterface`, `BaseFilter`

Field Summary
`static int` | `BOTTOM` Defines a rank order where ranking begins at the bottom of the cube going to the top.
`static int` | `COUNT` Defines a "Count" rank type where the numbers directly references the number of items to be returned.
`static java.lang.String` | `EVENT_BY_RANK_NAMES_CHANGED` Indication that by rank have been changed.
`static java.lang.String` | `EVENT_BY_RANK_ORDER_CHANGED` Indication that rank order have been changed.
`static java.lang.String` | `EVENT_BY_RANK_TYPE_CHANGED` Indication that rank type have been changed.
`static java.lang.String` | `EVENT_VALUE_CHANGED` Indication that rank value have been changed.
`static int` | `PERCENT` Defines a "Percent" rank type where the value defines the items that fall within that percentage.
`static int` | `SUM` Define a "Sum" rank type where the value defines the number which the items must equal when summed together.
`static int` | `TOP` Defines a rank order where ranking begins at the top of the cube going to the bottom.

Fields inherited from class com.sas.iquery.metadata.business.step.olap.BaseFilter
`EVENT_ACTION_TYPE_CHANGED, EVENT_LOCALIZABLE_LABELS_CHANGED`

Fields inherited from interface com.sas.iquery.metadata.business.step.StepFilterInterface
`APPEND_ACTION_TYPE, DIFFERENCE_ACTION_TYPE, INITIAL_ACTION_TYPE, INSERT_ACTION_TYPE, INTERSECT_ACTION_TYPE, PREPEND_ACTION_TYPE, SPECIAL_ACTION_TYPE, UNION_ACTION_TYPE`

Fields inherited from interface com.sas.iquery.metadata.business.Base
`EVENT_OBJECT_DEFINITION_CHANGED`

Fields inherited from interface com.sas.iquery.metadata.business.ModelItem
`EVENT_OBJECT_PROPERTY_CHANGED`

Constructor Summary
`DataItemRankFilter()` Constructor for persistence use only -- do not use
`DataItemRankFilter(int rankOrder, int value)` This constructor build a MDX expression that returns a specified number of items from the topmost or bottom members of a specified set (TopCount or BottomCount).
`DataItemRankFilter(int rankOrder, int value, boolean includeTies)` This constructor build a MDX expression that returns a specified number of items from the topmost or bottom members of a specified set (TopCount or BottomCount).
`DataItemRankFilter(int rankOrder, int value, java.util.List byRankQualifierNames, int rankType)` This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).
`DataItemRankFilter(int rankOrder, int value, java.util.List byRankQualifierNames, int rankType, boolean includeTies)` This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).
`DataItemRankFilter(int rankOrder, int value, java.lang.String[] byRankNames, int rankType)` This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).
`DataItemRankFilter(int rankOrder, int value, java.lang.String[] byRankNames, int rankType, boolean includeTies)` This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).

Method Summary
`java.lang.String` | `getbyRankName()` This method returns the name of the measure to be used for ranking.
`java.lang.String[]` | `getbyRankNames()` This method returns the names of the measures to be used for ranking.
`int` | `getRankOrder()` This method returns the ranking criteria to be used for ranking (either TOP or BOTTOM).
`java.util.List` | `getRankQualifiers()` This method returns the string expression of the measures to be used for ranking or a data item where data item is a measure.
`int` | `getRankType()` This method returns the order to be used for ranking.
`int` | `getValue()` This method returns the value to be used when ranking.
`boolean` | `isIncludeTies()` This method returns whether includeTies is true or false
`void` | `setbyRankName(java.lang.String byRankName)` This method defines the name of the measure to use for ranking.
`void` | `setbyRankNames(java.lang.String[] byRankNames)` This method defines the names of the measures to use for ranking.
`void` | `setIncludeTies(boolean includeTies)` This method defines include ties for TopCount or BottomCount
`void` | `setRankOrder(int rankOrder)` This method defines the type of ranking criteria to use for ranking.
`void` | `setRankQualifiers(java.util.List byRankQualifiers)` This method defines the names of the measures or data item where the data item is a measure that is to be used for ranking.
`void` | `setRankType(int rankType)` This method defines the type to use for ranking (either COUNT, SUM, and PERCENT)
`void` | `setValue(int value)` This method defines the value to use when ranking.

Methods inherited from class com.sas.iquery.metadata.business.step.olap.BaseFilter
`getActionType, getDisplayedText, getLevels, setActionType`

Methods inherited from interface com.sas.iquery.metadata.business.BusinessModelResourceReferencer
`getResources`

Methods inherited from interface com.sas.iquery.metadata.PropertyChangeListenee
`addListener, getListeners, removeListener`

Methods inherited from interface com.sas.iquery.metadata.business.UsabilityInterface
`getReasonsUnusable, isUsableInQuery`

Field Detail

### EVENT_BY_RANK_NAMES_CHANGED

    public static final java.lang.String EVENT_BY_RANK_NAMES_CHANGED

  Indication that by rank have been changed.

  See Also:
    Constant Field Values

### EVENT_BY_RANK_ORDER_CHANGED

    public static final java.lang.String EVENT_BY_RANK_ORDER_CHANGED

  Indication that rank order have been changed.

  See Also:
    Constant Field Values

### EVENT_BY_RANK_TYPE_CHANGED

    public static final java.lang.String EVENT_BY_RANK_TYPE_CHANGED

  Indication that rank type have been changed.

  See Also:
    Constant Field Values

### EVENT_VALUE_CHANGED

    public static final java.lang.String EVENT_VALUE_CHANGED

  Indication that rank value have been changed.

  See Also:
    Constant Field Values

### TOP

    public static final int TOP

  Defines a rank order where ranking begins at the top of the cube going to the bottom.

  See Also:
    Constant Field Values

### BOTTOM

    public static final int BOTTOM

  Defines a rank order where ranking begins at the bottom of the cube going to the top.

  See Also:
    Constant Field Values

### COUNT

    public static final int COUNT

  Defines a "Count" rank type where the numbers directly references the number of items to be returned. In each case, a value is specified which indicates the number of elements that will be included in the set.

  See Also:
    Constant Field Values

### PERCENT

    public static final int PERCENT

  Defines a "Percent" rank type where the value defines the items that fall within that percentage.

  See Also:
    Constant Field Values

### SUM

    public static final int SUM

  Define a "Sum" rank type where the value defines the number which the items must equal when summed together.

  See Also:
    Constant Field Values

Constructor Detail

### DataItemRankFilter

    public DataItemRankFilter(int rankOrder,
                              int value,
                              java.lang.String[] byRankNames,
                              int rankType)

  This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).

  Parameters:
    `rankOrder` - Order that ranking use or from starting location of ranking (either TOP or BOTTOM)
    `value` - Ranking Value.
    `byRankNames` - Names of measure or member that are used to determine rank (Null is accepted).

    Example: [Measures].[Actual_Sum] where Actual_Sum is a measure or [1993] where 1993 is a member of dimension.

    `rankType` - Type of ranking that will be used (either COUNT, SUM, and PERCENT)

### DataItemRankFilter

    public DataItemRankFilter(int rankOrder,
                              int value,
                              java.util.List byRankQualifierNames,
                              int rankType)

  This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).

  Parameters:
    `rankOrder` - Order that ranking use or from starting location of ranking (either TOP or BOTTOM)
    `value` - Ranking Value.
    `byRankQualifierNames` - DataItem (that are measures) or String Expression that are used to determine rank (Null is accepted).

    Example: [Measures].[Actual_Sum] where Actual_Sum is a measure or [1993] where 1993 is a member of dimension.

    `rankType` - Type of ranking that will be used (either COUNT, SUM, and PERCENT)

### DataItemRankFilter

    public DataItemRankFilter()

  Constructor for persistence use only -- do not use

### DataItemRankFilter

    public DataItemRankFilter(int rankOrder,
                              int value,
                              java.lang.String[] byRankNames,
                              int rankType,
                              boolean includeTies)

  This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).

  Parameters:
    `rankOrder` - Order that ranking use or from starting location of ranking (either TOP or BOTTOM)
    `value` - Ranking Value.
    `byRankNames` - Name of measure or member that are used to determine rank (Null is accepted).

    Example: [Measures].[Actual_Sum] where Actual_Sum is a measure or [1993] where 1993 is a member of dimension.

    `rankType` - Type of ranking that will be used (either COUNT, SUM, and PERCENT)
    `includeTies` - Define that results will include duplicates - Note: Restricted to TopCount or BottomCount at this time. If it is set to TRUE, then any member that has the same value as the last member will also be returned. The default value is FALSE.

### DataItemRankFilter

    public DataItemRankFilter(int rankOrder,
                              int value,
                              java.util.List byRankQualifierNames,
                              int rankType,
                              boolean includeTies)

  This constructor determines the ranking (whether from top to bottom and whether as a percent, sum, or count) of the members in a dimension based on the value of a measure(s).

  Parameters:
    `rankOrder` - Order that ranking use or from starting location of ranking (either TOP or BOTTOM)
    `value` - Ranking Value.
    `byRankQualifierNames` - DataItem (that are measures) or String Expression that are used to determine rank (Null is accepted).
    `rankType` - Type of ranking that will be used (either COUNT, SUM, and PERCENT)
    `includeTies` - Define that results will include duplicates - Note: Restricted to TopCount or BottomCount at this time. If it is set to TRUE, then any member that has the same value as the last member will also be returned. The default value is FALSE.

### DataItemRankFilter

    public DataItemRankFilter(int rankOrder,
                              int value)

  This constructor build a MDX expression that returns a specified number of items from the topmost or bottom members of a specified set (TopCount or BottomCount). If no byRankQualifierNames are applied for this class, [Measures].currentmember is applied as the qualifier.

  Parameters:
    `rankOrder` - Order that ranking use or from starting location of ranking (either TOP or BOTTOM)
    `value` - Ranking Value.

### DataItemRankFilter

    public DataItemRankFilter(int rankOrder,
                              int value,
                              boolean includeTies)

  This constructor build a MDX expression that returns a specified number of items from the topmost or bottom members of a specified set (TopCount or BottomCount). If no byRankQualifierNames are applied for this class, [Measures].currentmember is applied as the qualifier.

  Parameters:
    `rankOrder` - Order that ranking use or from starting location of ranking (either TOP or BOTTOM)
    `value` - Ranking Value.
    `includeTies` - Define that results will include duplicates - Note: Restricted to TopCount or BottomCount at this time. If it is set to TRUE, then any member that has the same value as the last member will also be returned. The default value is FALSE.

Method Detail

### setbyRankName

    public void setbyRankName(java.lang.String byRankName)

  This method defines the name of the measure to use for ranking. Typically this measure will be a measure when only one measure value is used. (If no byRankQualifierNames are applied for this class, [Measures].currentmember is applied as the qualifier.)

  Providing null on this method is equivalent to setbyRankNames(null) which causes a null to be returned by both getbyRankName() and getbyRankNames().

  Parameters:
    `byRankName` - Name of measure or member that are used to determine rank (Null is accepted).

    Example: [Measures].[Actual_Sum] where Actual_Sum is a measure or [1993] where 1993 is a member of dimension.

### setIncludeTies

    public void setIncludeTies(boolean includeTies)

  This method defines include ties for TopCount or BottomCount

  Parameters:
    `includeTies` - Define that results will include duplicates - Note: Restricted to TopCount or BottomCount at this time. If it is set to TRUE, then any member that has the same value as the last member will also be returned. The default value is FALSE.

### getbyRankName

    public java.lang.String getbyRankName()

  This method returns the name of the measure to be used for ranking.

  Returns:
    Name of measure or member that are used to determine rank

### isIncludeTies

    public boolean isIncludeTies()

  This method returns whether includeTies is true or false

  Returns:
    whether includeTies is true or false

### setRankQualifiers

    public void setRankQualifiers(java.util.List byRankQualifiers)

  This method defines the names of the measures or data item where the data item is a measure that is to be used for ranking.

  Parameters:
    `byRankQualifiers` - Name of measure or member that are used to determine rank (Null is accepted) or DataItem where dataitem is measure.

    Example: [Measures].[Actual_Sum] where Actual_Sum is a measure or [1993] where 1993 is a member of dimension.

### setbyRankNames

    public void setbyRankNames(java.lang.String[] byRankNames)

  This method defines the names of the measures to use for ranking.

  Setting a null array causes a null array to be returned by both getByRankNames() and getByRankName()

  Parameters:
    `byRankNames` - Name of measure or member that are used to determine rank (Null is accepted). Nulls in the array are not acceptable, a null array is acceptable.

    Example: [Measures].[Actual_Sum] where Actual_Sum is a measure or [1993] where 1993 is a member of dimension.

### getbyRankNames

    public java.lang.String[] getbyRankNames()

  This method returns the names of the measures to be used for ranking.

  Returns:
    Name of measure or member that are used to determine rank

### getRankQualifiers

    public java.util.List getRankQualifiers()

  This method returns the string expression of the measures to be used for ranking or a data item where data item is a measure.

  Returns:
    String Expressions of measure or member that are used to determine rank or DataItem where it is a measure.

### setRankOrder

    public void setRankOrder(int rankOrder)

  This method defines the type of ranking criteria to use for ranking.

  Parameters:
    `rankOrder` - The type of ranking criteria to be used for ranking

### getRankOrder

    public int getRankOrder()

  This method returns the ranking criteria to be used for ranking (either TOP or BOTTOM).

  Returns:
    The ranking criteria to be used for ranking

### setRankType

    public void setRankType(int rankType)

  This method defines the type to use for ranking (either COUNT, SUM, and PERCENT)

  Parameters:
    `rankType` - The order to be used for ranking

### getRankType

    public int getRankType()

  This method returns the order to be used for ranking.

  Returns:
    The order to be used for ranking

### setValue

    public void setValue(int value)

  This method defines the value to use when ranking.

  Parameters:
    `value` - The value to be used when ranking

### getValue

    public int getValue()

  This method returns the value to be used when ranking.

  Returns:
    The value to be used when ranking

*** This class is subject to change. ***

All Libraries | This Library | Package | Class | Use | Tree | Deprecated | Index | Grand Index | Help
|  | Query |
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2009 SAS Institute Inc. All Rights Reserved.