AnalyticModelDefn Class Methods

The following section discusses the AnalyticModelDefn class methods. The methods are discussed in alphabetical order.

Syntax

AddCube(CubeName)

Description

Use the AddCube method to add a new cube to the analytic model definition. This method fails if the cube specified by CubeName already exists.

Parameters

Field or Control

Definition

CubeName

Specify the name of a new cube that you want to add to the analytic model.

Returns

A CubeDefn object.

Syntax

AddCubeCollection(CubeCollectionName)

Description

Use the AddCubeCollection method to add a new cube collection to the analytic model definition. This method fails if CubeCollectionName already exists.

Parameters

Field or Control

Definition

CubeCollectionName

Specify the name of a new cube collection that you want to add to the analytic model definition.

Returns

A CubeCollectionDefn object.

Syntax

AddDimension(DimName)

Description

Use the AddDimension method to add a new dimension to the analytic model. This method fails if the specified dimension already exists.

When you add a dimension to a cube, the dimension is also automatically added to any cube collections that already contain the cube.

Parameters

Field or Control

Definition

DimName

Specify the name of the dimension you want to add. This must be a new dimension.

Returns

A DimensionDef object.

Syntax

AddExplicitDimensionSet(ExplicitDimSetName)

Description

Use the AddExplicitDimensionSet method to add a new explicit dimension set to the analytic model. This method fails if the specified explicit dimension set already exists.

Parameters

Field or Control

Definition

ExplicitDimSetName

Specify the name of the explicit dimension you want to add. This must be a new explicit dimension.

Returns

An ExplicitDimensionSet object.

Syntax

AddOrganizer(OrganizerName)

Description

Use the AddOrganizer method to add a new organizer to the analytic model. This method fails if the organizer specified by OrganizerName already exists.

Parameters

Field or Control

Definition

OrganizerName

Specify the name of the organizer you want to add.

Returns

An OrganizerDefn object.

Syntax

AddUserFunction(UserFunctionName)

Description

Use the AddUserFunction method to add a new user function to the analytic model. This method fails if the user function specified by UserFunction already exists.

Parameters

Field or Control

Definition

UserFunctionName

Specify the name of the new user function that you want to add.

Returns

A UserFunction object.

Syntax

CopyCube(CubeName, NewCubeName)

Description

Use the CopyCube method to copy the specified cube to the new cube. This method fails if the cube specified by CubeName already exists.

Parameters

Field or Control

Definition

CubeName

Specify the name of the cube that you want to copy.

NewCubeName

Specify the name of the new cube that you want to create.

Returns

A CubeDefn object.

Syntax

CopyCubeCollection(CubeCollectionName, NewCubeCollectionName)

Description

Use the CopyCubeCollection method to copy the specified cube collection to a new collection. If the new cube collection specified by NewCubeCollectionName already exists, this method fails.

Parameters

Field or Control

Definition

CubeCollectionName

Specify the name of the cube collection that you want to copy.

NewCubeCollectionName

Specify the name you want for the new cube collection.

Returns

A CubeCollectionDefn object.

Syntax

CopyDimension(DimName, NewDimName)

Description

Use the CopyDimension method to copy the dimension specified by DimName to a new dimension. If the dimension specified by NewDimName already exists, this method fails.

Parameters

Field or Control

Definition

DimName

Specify the name of the dimension that you want to copy.

NewDimName

Specify the name of the new dimension that you want the data copied to.

Returns

A DimensionDefn object.

Syntax

CopyExplicitDimensionSet(ExplicitDimSetName, NewExplicitDimSetName)

Description

Use the CopyExplicitDimensionSet method to copy the explicit dimension set specified by ExplicitDimSetName to a new explicit dimension set. If the explicit dimension set specified by NewExplicitDimSetName already exists, this method fails.

Parameters

Field or Control

Definition

ExplicitDimSetName

Specify the name of the explicit dimension set that you want to copy.

NewExplicitDimSetName

Specify the name of the new explicit dimension set that you want the data copied to.

Returns

An ExplicitDimensionSet object.

Syntax

CopyTo(NewModelName)

Description

Use the CopyTo method to copy the AnalyticModelDefn object to a new analytic model specified by NewModelName. If the model set specified by NewModelName already exists, this method fails.

Parameters

Field or Control

Definition

NewModelName

Specify the name of a new analytic model definition that you want to create.

Returns

An AnalyticModelDefn object.

Syntax

CopyUserFunction(UserFunctionName, NewUserFunctionName)

Description

Use the CopyUserFunction method to copy the user function specified by UserFunctionName to a new user function. If the user function specified by NewUserFunctionName already exists, this method fails.

Parameters

Field or Control

Definition

UserFunctionName

Specify the name of the user function that you want to copy.

NewUserFunctionName

Specify the name of the new user function that you want to add.

Returns

A UserFunctionDefn object.

Syntax

Create()

Description

Use the Create method to create, and instantiate, a new model. If you save the new model after you create it, you can then access it in Application Designer as an analytic model definition.

If the model already exists, an exception is thrown.

Parameters

None.

Returns

None.

Syntax

Delete()

Description

Use the Delete method to delete the analytic model executing the method.

You can only use this method on a closed analytic model definition, that is, before you use a Get or Create method.

Warning! The delete occurs immediately, that is, the analytic model definition is removed from the database. Only use this method if you're certain you want to delete the definition.

If this model is used by any existing analytic type definition, this method fails.

Parameters

None.

Returns

None.

Syntax

DeleteCube(CubeName, ForceDelete)

Description

Use the DeleteCube method to delete the cube specified by CubeName.

Parameters

Field or Control

Definition

CubeName

Specify the name of the cube you want to delete from the analytic model.

ForceDelete

Specify if the cube should always be deleted. This parameter takes a Boolean value. If you specify ForceDelete as false, and the cube is used by another part (such as a cube collection) this method fails. If you specify ForceDelete as true, and the cube is used by another part, the cube is still deleted.

Returns

None.

Syntax

DeleteCubeCollection(CubeCollectionName, ForceDelete)

Description

Use the DeleteCubeCollection method to delete the cube collection specified by CubeCollectionName.

Parameters

Field or Control

Definition

CubeCollectionName

Specify the name of the cube collection that you want to delete from the analytic model.

ForceDelete

Specify if the cube collection should always be deleted. This parameter takes a Boolean value. If you specify ForceDelete as false, and the cube collection is used by another part (such as an Organizer), this method fails. If you specify ForceDelete as true, and the cube collection is used by another part, the cube collection is still deleted.

Returns

None.

Syntax

DeleteDimension(DimensionName, ForceDelete)

Description

Use the DeleteDimension method to delete the dimension specified by DimensionName.

Parameters

Field or Control

Definition

DimensionName

Specify the name of the dimension you want to delete.

ForceDelete

Specify if the dimension should always be deleted. This parameter takes a Boolean value. If you specify ForceDelete as false, and the dimension is used by another part (such as a cube), this method fails. If you specify ForceDelete as true, and the dimension is used by another part, the dimension is still deleted.

Returns

None.

Syntax

DeleteExplicitDimensionSet(ExplicitDimensionSetName, ForceDelete)

Description

Use the DeleteExplicitDimensionSet method to delete the explicit dimension set specified by ExplicitDimensionSetName.

Parameters

Field or Control

Definition

ExplicitDimensionSetName

Specify the name of the explicit dimension set you want to delete.

ForceDelete

The value of this parameter is ignored in the current release.

Returns

None.

Syntax

DeleteOrganizer(OrganizerName, ForceDelete)

Description

Use the DeleteOrganizer method to delete the organizer specified by OrganizerName.

Parameters

Field or Control

Definition

OrganizerName

Specify the name of the organizer you want to delete.

ForceDelete

This value is ignored in the current release.

Returns

None.

Syntax

DeleteUserFunction(UserFunctionName, ForceDelete)

Description

Use the DeleteUserFunction method to delete the user function specified by UserFunctionName.

Parameters

Field or Control

Definition

UserFunctionName

Specify the name of the user function you want to delete.

ForceDelete

Specify if the user function should always be deleted. This parameter takes a Boolean value. If you specify ForceDelete as false, and the user function is used by another part, this method fails. If you specify ForceDelete as true, and the user function is used by another part, the user function is still deleted.

Returns

None.

Syntax

Get()

Description

Use the Get method to instantiate an instance of the analytic model.

If the model doesn't exist, an exception is thrown.

Parameters

None.

Returns

None.

Syntax

GetCube(CubeName)

Description

Use the GetCube method to return a reference to the cube specified by CubeName. This method fails if the cube specified by CubeName doesn't exist.

Parameters

Field or Control

Definition

CubeName

Specify the name of the cube that you want a reference to.

Returns

A CubeDefn object.

Syntax

GetCubeCollection(CubeCollectionName)

Description

Use the GetCubeCollection method to return a reference to a cube collection. This method fails if the cube collection specified by CubeCollectionName doesn't exist.

Parameters

Field or Control

Definition

CubeCollection

Specify the name of the cube collection you want a reference to.

Returns

A CubeCollectionDefn object.

Syntax

GetCubeCollectionNames()

Description

Use the GetCubeCollectionNames method to return an array of strings containing all the names of the cube collections associated with this analytic model.

Parameters

None.

Returns

An array of string.

Syntax

GetCubeNames()

Description

Use the GetCubeNames method to return an array of strings containing all the names of the cubes associated with this analytic model.

Parameters

None.

Returns

An array of string.

Syntax

GetDimension(DimName)

Description

Use the GetDimension method to return a reference to the dimension specified by DimName. This method fails if the dimension specified by DimName doesn't exist.

Parameters

Field or Control

Definition

DimName

Specify the name of the dimension that you want a reference to.

Returns

A DimensionDefn object.

Syntax

GetDimensionNames()

Description

Use the GetDimensionNames method to return an array of string containing the names of all the dimensions associated with the analytic model.

Parameters

None.

Returns

An array of string.

Syntax

GetExplicitDimensionSet(ExplicitDimSetName)

Description

Use the GetExplicitDimensionSet method to return a reference to the explicit dimension set specified by ExplicitDimSetName. This method fails if the explicit dimension set specified by ExplicitDimSetName doesn't exist.

Parameters

Field or Control

Definition

ExplicitDimSetName

Specify the name of the explicit dimension set that you want a reference to.

Returns

An ExplicitDimensionSet object.

Syntax

GetExplicitDimensionSetNames()

Description

Use the GetExplicitDimensionSetNames method to return an array of string containing the names of all the explicit dimension sets associated with the analytic model.

Parameters

None.

Returns

An array of strings.

Syntax

GetOrganizer(OrganizerName)

Description

Use the GetOrganizer method to return a reference to the organizer specified by OrganizerName. This method fails if the organizer specified by OrganizerName doesn't exist.

Parameters

Field or Control

Definition

OrganizerName

Specify the name of the organizer you want a reference to.

Returns

An OrganizerDefn object.

Syntax

GetOrganizerNames()

Description

Use the GetOrganizerNames method to return an array of string containing the names of all the organizers associated with the analytic model.

Parameters

None.

Returns

An array of string.

Syntax

GetUserFunction(UserFunctionName)

Description

Use the GetUserFunction method to return a reference to the user function specified by UserFunctionName. This method fails if the user function specified by UserFunctionName doesn't exist.

Parameters

Field or Control

Definition

UserFunctionName

Specify the name of a user function that you want a reference to.

Returns

A UserFunctionDefn object

Syntax

GetUserFunctionNames()

Description

Use the GetUserFunctionNames method to return an array of string containing the names of all the user functions associated with the analytic model.

Parameters

None.

Returns

An array of string.

Syntax

Rename(NewModelName)

Description

Use the Rename method to rename the analytic model.

You can only use this method on a closed analytic model definition, that is, before you use a Get or Create method.

Parameters

Field or Control

Definition

NewModelName

Specify the new name of the model.

Returns

None.

Syntax

RenameCube(CubeName, NewCubeName, ForceRename)

Description

Use the RenameCube method to rename the cube specified by CubeName to NewCubeName.

Parameters

Field or Control

Definition

CubeName

Specify the name of the cube you want to rename.

NewCubeName

Specify the new name for the cube.

ForceRename

Specify if the cube should always be renamed. This parameter takes a Boolean value. If you specify ForceRename as false, and the cube is used by another part (such as a cube collection) this method fails. If you specify ForceRename as true, and the cube is used by another part, the cube is still renamed.

Returns

None.

Syntax

RenameCubeCollection(CubeCollectionName, NewCubeCollectionName, ForceRename

Description

Use the RenameCubeCollection method to rename the cube collection specified by CubeCollectionName to the new name NewCubeCollectionName

Parameters

Field or Control

Definition

CubeCollectionName

Specify the name of the cube collection that you want to rename.

NewCubeCollectionName

Specify the new name of the cube collection.

ForceRename

Specify if the cube collection should always be renamed. This parameter takes a Boolean value. If you specify ForceRename as false, and the cube collection is used by another part (such as an organizer) this method fails. If you specify ForceRename as true, and the cube collection is used by another part, the cube collection is still renamed.

Returns

None.

Syntax

RenameDimension(DimName, NewDimName, ForceRename)

Description

Use the RenameDimension method to rename the dimension specified by DimName to the new name NewDimName.

Parameters

Field or Control

Definition

DimName

Specify the name of the dimension you want to rename.

NewDimName

Specify the new name of the dimension.

ForceRename

Specify if the dimension should always be renamed. This parameter takes a Boolean value. If you specify ForceRename as false, and the dimension is used by another part (such as a cube) this method fails. If you specify ForceRename as true, and the dimension is used by another part, the dimension is still renamed.

Returns

None.

Syntax

RenameExplicitDimensionSet(ExplicitDimSetName, NewExplicitDimSetName, ForceRename)

Description

Use the RenameExplicitDimensionSet method to rename the explicit dimension set specified by ExplicitDimSetName to the new name NewExplicitDimSetName.

Parameters

Field or Control

Definition

ExplicitDimSetName

Specify the name of the explicit dimension set you want to rename.

NewExplicitDimSetName

Specify the new name of the explicit dimension set.

ForceRename

The value for this parameter is ignored in the current release.

Returns

None.

Syntax

RenameOrganizer(OrganizerName, NewOrganizerName, ForceRename)

Description

Use the RenameOrganizer method to rename the organizer specified by OrganizerName to the new name NewOrganizerName.

Parameters

Field or Control

Definition

OrganizerName

Specify the name of the organizer you want to rename.

NewOrganizerName

Specify the new name for the organizer.

ForceRename

The value for this parameter is ignored in the current release.

Returns

None.

Syntax

RenameUserFunction(UserFunctionName, NewUserFunctionName, ForceRename)

Description

Use the RenameUserFunction method to rename the user function specified by UserFunctionName to the new name NewUserFunctionName.

Parameters

Field or Control

Definition

UserFunctionName

Specify the name of the user function you want to rename.

NewUserFunctionName

Specify the new name for the user function.

ForceRename

Specify if the user function should always be renamed. This parameter takes a Boolean value. If you specify ForceRename as false, and the user function is used by another part this method fails. If you specify ForceRename as true, and the user function is used by another part, the user function is still renamed.

Returns

None.

Syntax

Save()

Description

Use the Save method to save any changes to the analytic model definition to the database. If the saved model is valid, the value of the IsValid property is set to true, if it is not valid, it is set to false.

The Messages property is populate with messages from the validation that occurs with the save.

Parameters

None.

Returns

None.

Syntax

Validate()

Description

Use the Validate method to validate the analytic model definition. This method returns true if the model successfully validates. If this method returns false, the detailed error messages are available through the Messages property.

The IsValid property is not set with this method. The Save method sets the IsValid property.

Parameters

None.

Returns

A Boolean value: true if the analytic model definition validates successfully, false otherwise.