A step that ranks a business query 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 <> 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 <> 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 <> 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 <> 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 <>, 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.
BusinessQueryRankFilter(java.lang.String 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).
BusinessQueryRankFilter(java.lang.String 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).
BusinessQueryRankFilter(java.lang.String rankOrder,
int value,
java.util.List byRankQualifierNames,
java.lang.String 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).
BusinessQueryRankFilter(java.lang.String rankOrder,
int value,
java.util.List byRankQualifierNames,
java.lang.String 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).
getDisplayedText(com.sas.storage.olap.MetadataInterface metadata,
Role role,
boolean applyPromptValues,
java.util.Locale locale)
Return the displayed text for a step rather than a OLAP type of text.
setRankQualifiers(java.util.List byRankQualifiers)
This method defines the names of the measures or dataitem where the dataitem is a measure that is to be use for
ranking (If no byRankQualifierNames are
applied for this class, [Measures].currentmember is applied as the qualifier.)
void
setRankType(java.lang.String 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
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.
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 statting 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)
BusinessQueryRankFilter
public BusinessQueryRankFilter()
This constructor is used only for persistence. Not for general use.
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 statting 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.
BusinessQueryRankFilter
public BusinessQueryRankFilter(java.lang.String 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 statting location of ranking (either TOP or BOTTOM)
value - Ranking Value.
BusinessQueryRankFilter
public BusinessQueryRankFilter(java.lang.String 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 statting 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
isIncludeTies
public boolean isIncludeTies()
This method returns whether includeTies is true or false
Returns:
whether includeTies is true or false
getDisplayedText
public java.lang.StringgetDisplayedText(com.sas.storage.olap.MetadataInterface metadata,
Role role,
boolean applyPromptValues,
java.util.Locale locale)
Return the displayed text for a step rather than a OLAP type of text.
Parameters:
metadata -
dataItem -
show - prompt values or prompt labels
Returns:
setRankQualifiers
public void setRankQualifiers(java.util.List byRankQualifiers)
This method defines the names of the measures or dataitem where the dataitem is a measure that is to be use for
ranking (If no byRankQualifierNames are
applied for this class, [Measures].currentmember is applied as the qualifier.)
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.
This method returns the ranking criteria to be used for ranking (either TOP or BOTTOM).
Returns:
The ranking criteria to be used for ranking
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.