|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.iquery.metadata.expr.FractionOfTotalExpression
public class FractionOfTotalExpression
Models a numeric expression that represents a fraction of a total value in a business query.
This modeled fraction is of the form A/B where A is a numeric measure data item on one axis of the query and B is a category data item on the other axis of the query. By axis we mean the ROW or COLUMN Role applied to a data item that is a result item in the query. The A/B expression is a division, or comparison, that results in a fractional value. If desired, this fractional value can be formatted with the SAS PERCENTw.d format (for example, PERCENT4.1) so that it may be easily displayed in visual percentage form.
The numerator, A, as a numeric measure data item is straightforward to specify. Specifying the denominator is a bit more complex. This is because the specific axis the denominator is set on affects the results of the query.
This expression is only supported when directly set on a DataItem and used as a result item in a query. Use of this expression as a subexpression is not supported.
Field Summary | |
---|---|
static int |
DENOMINATOR_IS_COLUMN_SUBTOTAL
A constant used to indicate that the denominator to be used in calculating the fraction is the subtotal values on column axis. |
static int |
DENOMINATOR_IS_COLUMN_TOTAL
A constant used to indicate that the denominator to be used in calculating the fraction is the column total value. |
static int |
DENOMINATOR_IS_GRAND_TOTAL
A constant used to indicate that the denominator to be used in calculating the fraction is the grand total value. |
static int |
DENOMINATOR_IS_ROW_SUBTOTAL
A constant used to indicate that the denominator to be used in calculating the fraction is the subtotal values on row axis. |
static int |
DENOMINATOR_IS_ROW_TOTAL
A constant used to indicate that the denominator to be used in calculating the fraction is the row total value. |
static int |
DENOMINATOR_IS_SUBTOTAL_OF_CATEGORY_DATA_ITEM
A constant used to indicate that the denominator to be used in calculating the fraction is the subtotal values for the category data item set on this expression. |
static java.lang.String |
EVENT_DENOMINATOR_CHANGED
Indication that the denominator specification (the category data item or denominator value) have changed. |
static java.lang.String |
EVENT_NUMERATOR_CHANGED
Indication that the numerator has changed. |
Fields inherited from interface com.sas.iquery.metadata.business.ModelItem |
---|
EVENT_OBJECT_PROPERTY_CHANGED |
Fields inherited from interface com.sas.iquery.metadata.business.Base |
---|
EVENT_OBJECT_DEFINITION_CHANGED |
Constructor Summary | |
---|---|
FractionOfTotalExpression()
Instantiates a new FractionOfTotalExpression object with no numerator or denominator set. |
Method Summary | |
---|---|
DataItem |
getDenominator()
Returns the denominator of this fraction expression. |
int |
getDenominatorType()
Returns a value indicating which type of denominator value to use. |
int |
getExpressionType()
Return the integer form of the expression type. |
DataItem |
getNumerator()
Returns the numerator data item used in the computation of the fractional value. |
void |
setDenominator(DataItem denominator)
Sets the denominator of this fraction expression to be the subtotal values for the given category data item. |
void |
setDenominatorType(int denominatorType)
Sets the denominator of this expression to the given value -- from the list of constant values in this class that start with the letters "DENOMINATOR_IS_". |
void |
setNumerator(DataItem numerator)
Sets the numerator used in the computation of the fractional value to be the specified data item. |
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 |
---|
public static final java.lang.String EVENT_NUMERATOR_CHANGED
public static final java.lang.String EVENT_DENOMINATOR_CHANGED
public static final int DENOMINATOR_IS_SUBTOTAL_OF_CATEGORY_DATA_ITEM
Note: This value is only applicable to relational table or ROLAP (as of Version 9.2)
public static final int DENOMINATOR_IS_GRAND_TOTAL
public static final int DENOMINATOR_IS_ROW_TOTAL
public static final int DENOMINATOR_IS_COLUMN_TOTAL
public static final int DENOMINATOR_IS_ROW_SUBTOTAL
public static final int DENOMINATOR_IS_COLUMN_SUBTOTAL
Constructor Detail |
---|
public FractionOfTotalExpression()
Method Detail |
---|
public DataItem getNumerator()
public void setNumerator(DataItem numerator) throws MetadataException
numerator
- to be used in the computation of the fractional value
java.lang.IllegalArgumentException
- when a non-null measure data item is given as the numerator.
MetadataException
public DataItem getDenominator()
public void setDenominator(DataItem denominator) throws MetadataException
denominator
- a category data item (getUsage() returns DataItemActionType.USAGE_CATEGORY)
to be used as the denominator in this expression.
java.lang.IllegalArgumentException
- when a non-null non-category data item is given as the denominator.
MetadataException
public void setDenominatorType(int denominatorType)
denominatorType
- a value indicating how the denominator portion of the fraction
should be determined. Values set on this method should be
static constant integers from this class
that start with the letters "DENOMINATOR_IS_".
java.lang.IllegalArgumentException
- when a value other than one of the valid constants
is specified.public int getDenominatorType()
public int getExpressionType()
ExpressionInterface
getExpressionType
in interface ExpressionInterface
|
Query |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |