|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.iquery.metadata.business.Role
public class Role
Specifies the different multidimensional roles that a data item can take when it is used in the list of result items that is managed by the BusinessQuery interface.
Roles Definition by Data Source Type:
Relational Roles
The roles of data items have a special meaning when you are building relational queries:
in order to return a plain table, all data items in a relational query must have a role of
COLUMN
.
If any items in a relational query have a role of ROW
,
then the result will not be a regular tabular result set,
but instead will be a multi-dimensional cross tabular data set, similar to those that are returned by OLAP queries.
The role of HIDDEN
will define several common uses:
Unlike relational queries, the type of result that is returned for OLAP queries is always multi-dimensional, even if all the items are to be set to be on the COLUMN role. Roles have multiple purposes for the OLAP data selection. A role can define an axis specification or a slicer specification.
A role can also define whether a data item is included in the query or whether the data item is visible.
If a role of HIDDEN
is applied, the data item is not included in the query and it is not visible.
An axis specification - This would mean that a dataItem was defined as a ROW or COLUMN. It defines the dataItem as units (members) along each output axis (defined as a vertical or horizonal axis)
A slicer specification - a role of BACKGROUND
defines what slice of the
cube is to aggregated. Applying a slicer role would define a where clause. The WHERE clause further
restricts the result set. The axis that is formed by the WHERE clause is referred to as the slicer.
The WHERE clause determines which dimension or member is used as a slicer dimension. This restricts the extracting of data
to a specific dimension or member. Any dimension that does not appear on the output axis (in the SELECT clause as either a ROW or COLUMN)
can be named on the slicer.
For example: To limit the result to Sales in 1997 and display only Unit Sales, these hierarchical levels are placed in the slicer specification.
Summary of Rules on How Roles are Applied to OLAP Data Items:
All data items must have a role of either COLUMN
or
a role of ROW
, it will result in a multi-dimensional cross tabular
data set, similar to those that are returned by OLAP queries.
The Role of BACKGROUND
will result in the item not being used as a result column,
or included in the sort items or groupings.
The Role of HIDDEN
will result in the item not being used as a result column,
but it will be included as a sort item and in the groupings. This can cause multiple rows to return with identical grouping
category values.
Field Summary | |
---|---|
static Role |
BACKGROUND
This role is used, when specifying a data item as a result item in a BusinessQuery, to request the result item to be on the BACKGROUND axis in the result set returned by SAS Query Services' data services component when processing the query. |
static Role |
COLUMN
This role is used, when specifying a data item as a result item in a BusinessQuery, to request a result item to be on the COLUMN axis in the result set returned by SAS Query Services' data services component when processing the query. |
static Role |
HIDDEN
This role is used, when specifying a data item as a result item in a BusinessQuery, to request the result item to be processed as if it were to be returned as a result item but to not return it in the resultset. |
static Role |
PAGE
Deprecated. do not use |
static Role |
ROW
This role is used, when specifying a data item as a result item in a BusinessQuery, to request a result item to be on the ROW axis in the result set returned by SAS Query Services' data services component when processing the query. |
Method Summary | |
---|---|
static boolean |
isInactiveRole(BusinessQuery query,
Role role)
Checks the role specified for the query specified to see if that role when assigned to a result item will result in the result item being ignored. |
static boolean |
isOutputResultRole(BusinessQuery query,
Role role)
Returns true if the an item using this role will be displayed as an output result on an axis or in a cell. |
Field Detail |
---|
public static final Role ROW
If assigning this role is not valid for a given data item in the context of how other data items and their roles are assigned in a query, the query will become invalid and a Reason object is available via the BusinessQuery.getReasonsNotValid() method.
public static final Role COLUMN
If assigning this role is not valid for a given data item in the context of how other data items and their roles are assigned in a query, the query will become invalid and a Reason object is available via the BusinessQuery.getReasonsNotValid() method.
public static final Role BACKGROUND
If assigning this role is not valid for a given data item in the context of how other data items and their roles are assigned in a query, the query will become invalid and a Reason object is available via the BusinessQuery.getReasonsNotValid() method.
public static final Role PAGE
If assigning this role is not valid for a given data item in the context of how other data items and their roles are assigned in a query, the query will become invalid and a Reason object is available via the BusinessQuery.getReasonsNotValid() method.
public static final Role HIDDEN
Several common uses of this role are:
BusinessQuery.setSortOrderPrecedence
method.
If assigning this role is not valid for a given data item in the context of how other data items and their roles are assigned in a query, the query will become invalid and a Reason object is available via the BusinessQuery.getReasonsNotValid() method.
Method Detail |
---|
public static boolean isInactiveRole(BusinessQuery query, Role role)
query
- BusinessQuery that is being examined.role
- Selected item's role.
public static boolean isOutputResultRole(BusinessQuery query, Role role)
query
- role
-
isInactiveRole(BusinessQuery,Role)
|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |