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

com.sas.iquery.metadata.expr.olap
Class TimeExpressionMeasure

com.sas.iquery.metadata.expr.olap.TimeExpressionMeasure
All Implemented Interfaces:
Base, BusinessModelResourceReferencer, ModelItem, UsabilityInterface, ExpressionInterface, PropertyChangeListenee, java.beans.PropertyChangeListener, java.lang.Cloneable, java.util.EventListener

public class TimeExpressionMeasure
implements ExpressionInterface

Models an expression to create a relative time-based calculated measure. It defines the measure as one of the following:


Field Summary
static java.lang.String CUMULATIVE
          This is a function that will calculate the cumulative value in measure over a period.
static java.lang.String DIFFERENCE_PREVIOUS_PERIOD
          This is a function that will calculate the difference in measure between current period and previous period.
static java.lang.String DIFFERENCE_PREVIOUS_YEAR
          This is a function that will calculate the difference in measure between current year and previous year.
static java.lang.String EVENT_START_PERIOD_CHANGED
          Event that indicates a change in period being used for the time calculations
static java.lang.String EVENT_TIME_FUNCTION_CHANGED
          Event that indicates a change in type of function used - DIFFERENCE_PARELLELPERIOD, PERCENTCHANGE_PARELLELPERIOD, DIFFERENCE_PERIODTODATE, PERCENTCHANGE_PERIODTODATE, OR CUMULATIVE
static java.lang.String EVENT_TIME_MEASURE_CHANGED
          Event that indicates a change in the data item measure being used for the time calculations
static java.lang.String PERCENTCHANGE_PREVIOUS_PERIOD
          This is a function that will calculate the percentage of difference in a measure between current period and previous period.
static java.lang.String PERCENTCHANGE_PREVIOUS_YEAR
          This is a function that will calculate the percentage of difference in a measure between current year and previous year.
 
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
TimeExpressionMeasure()
          Create object used to build the MDX expression for creating a time-based calculated measure.
TimeExpressionMeasure(DataItem measure, java.lang.String function)
          Create object used to build the MDX expression for creating a time-based calculated measure.
 
Method Summary
 int getExpressionType()
          Always returns ExpressionTypes.EXP_TYPE_NUMERIC
 java.lang.String getFunction()
          Returns the operation selected by user.
 DataItem getMeasure()
          Returns the name of the measure being used in the calculated member formula.
 java.lang.String getPeriod()
          Returns starting period - For example: [TIME].
 void setFunction(java.lang.String function)
          Sets the type of operation the user wishes to perform.
 void setMeasure(DataItem measure)
          Sets the name of the measure being used in the calculated member formula.
 void setPeriod(java.lang.String startingPeriod)
          Sets starting period - For example: [TIME].
 
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_TIME_MEASURE_CHANGED

public static final java.lang.String EVENT_TIME_MEASURE_CHANGED
Event that indicates a change in the data item measure being used for the time calculations

See Also:
Constant Field Values

EVENT_TIME_FUNCTION_CHANGED

public static final java.lang.String EVENT_TIME_FUNCTION_CHANGED
Event that indicates a change in type of function used - DIFFERENCE_PARELLELPERIOD, PERCENTCHANGE_PARELLELPERIOD, DIFFERENCE_PERIODTODATE, PERCENTCHANGE_PERIODTODATE, OR CUMULATIVE

See Also:
Constant Field Values

EVENT_START_PERIOD_CHANGED

public static final java.lang.String EVENT_START_PERIOD_CHANGED
Event that indicates a change in period being used for the time calculations

See Also:
Constant Field Values

DIFFERENCE_PREVIOUS_PERIOD

public static final java.lang.String DIFFERENCE_PREVIOUS_PERIOD
This is a function that will calculate the difference in measure between current period and previous period.

See Also:
Constant Field Values

DIFFERENCE_PREVIOUS_YEAR

public static final java.lang.String DIFFERENCE_PREVIOUS_YEAR
This is a function that will calculate the difference in measure between current year and previous year.

See Also:
Constant Field Values

PERCENTCHANGE_PREVIOUS_PERIOD

public static final java.lang.String PERCENTCHANGE_PREVIOUS_PERIOD
This is a function that will calculate the percentage of difference in a measure between current period and previous period.

See Also:
Constant Field Values

PERCENTCHANGE_PREVIOUS_YEAR

public static final java.lang.String PERCENTCHANGE_PREVIOUS_YEAR
This is a function that will calculate the percentage of difference in a measure between current year and previous year.

See Also:
Constant Field Values

CUMULATIVE

public static final java.lang.String CUMULATIVE
This is a function that will calculate the cumulative value in measure over a period.

See Also:
Constant Field Values
Constructor Detail

TimeExpressionMeasure

public TimeExpressionMeasure()
Create object used to build the MDX expression for creating a time-based calculated measure. This measure will calculate the difference or percentage difference in a particular measure for a particular period or particular parellel period. It will also calculate the cumulative amount for that same measure.

This object will contain the name of the calculated member defined by the user, the numeric expression used in the functions, the desired operation, and whether to replace the currently displayed measure with the new one or add the new measure to the existing set of displayed measures. When totaling is applied to a query that contains this measure, the totaling the TimeExpressionMeasure is governed by the following rules:


TimeExpressionMeasure

public TimeExpressionMeasure(DataItem measure,
                             java.lang.String function)
Create object used to build the MDX expression for creating a time-based calculated measure.

Parameters:
measure - - sets the name of the measure being used in the calculated member formula.
function - - sets the type of operation the user wishes to perform using valid functions: DIFFERENCE_PREVIOUS_PERIOD, DIFFERENCE_PERIOD, DIFFERENCE_PREVIOUS_YEAR, DIFFERENCE_YEAR,PERCENTCHANGE_PREVIOUS_YEAR PERCENTCHANGE_YEAR, PERCENTCHANGE_PERIOD,PERCENTCHANGE_PREVIOUS_PERIOD OR CUMULATIVE
Method Detail

setMeasure

public void setMeasure(DataItem measure)
                throws java.lang.IllegalArgumentException
Sets the name of the measure being used in the calculated member formula.

Parameters:
measure - the DataItem measure
Throws:
java.lang.IllegalArgumentException

getMeasure

public DataItem getMeasure()
Returns the name of the measure being used in the calculated member formula.

Returns:
a dataItem containing the measure name

setFunction

public void setFunction(java.lang.String function)
                 throws java.lang.IllegalArgumentException
Sets the type of operation the user wishes to perform. Valid values are DIFFERENCE_PREVIOUS_PERIOD, DIFFERENCE_PREVIOUS_YEAR, PERCENTCHANGE_PREVIOUS_YEAR, PERCENTCHANGE_PREVIOUS_PERIOD OR CUMULATIVE

Parameters:
function - type of function
Throws:
java.lang.IllegalArgumentException

getFunction

public java.lang.String getFunction()
Returns the operation selected by user.

Returns:
a String containing DIFFERENCE_PREVIOUS_PERIOD, DIFFERENCE_PREVIOUS_YEAR, PERCENTCHANGE_PREVIOUS_YEAR, PERCENTCHANGE_PREVIOUS_PERIOD OR CUMULATIVE
Throws:
java.lang.IllegalArgumentException

setPeriod

public void setPeriod(java.lang.String startingPeriod)
Sets starting period - For example: [TIME].[All TIME].[1993].[1].[Jan]

Parameters:
startingPeriod - starting period

getPeriod

public java.lang.String getPeriod()
Returns starting period - For example: [TIME].[All TIME].[1993].[1].[Jan]

Returns:
String starting period

getExpressionType

public int getExpressionType()
Always returns ExpressionTypes.EXP_TYPE_NUMERIC

Specified by:
getExpressionType in interface ExpressionInterface
Returns:
an expression type from class ExpressionTypes

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.