# EssOtlDeleteDimension

Description

EssOtlDeleteDimension() deletes a dimension from the outline. The call also specifies a member of the dimension being deleted from which to keep data when the outline is restructured.

Syntax

    ESS_FUNC_M EssOtlDeleteDimension (hOutline, hMember, pszDataMbr);

ESS_HOUTLINE_T | hOutline
ESS_HMEMBER_T | hMember
ESS_STR_T | pszDataMbr

Parameters

hOutline | Outline context handle.
hMember | Handle of member to delete.
pszDataMbr | Member name in the dimension to be deleted from which data will be saved when the outline is restructured. If this field is ESS_NULL, the dimension is used.

Return Value

Returns 0 if successful; otherwise:

OTLAPI_ERR_ADDDELETEDIMDYNAMICCALC
OTLAPI_ERR_NOTIMEDIM

Notes

- All shared members of the dimension and its descendants are deleted.
- All members of the dimension are deleted.
- To delete a dimension, you can use this call or EssOtlDeleteMember(). EssOtlDeleteDimension() gives you the benefit of selecting a member of the deleted dimension whose data values will be used as the data values for the other dimensions when the database is restructured. If EssOtlDeleteMember() is used, the data values of the top member (dimension) of the deleted dimension are used.
- In order for the pszDataMbr field to take effect, the outline must have been opened with EssOtlOpenOutline() with the fKeepTrans flag set to ESS_TRUE.

Example

    #include <essapi.h>
    #include <essotl.h>

    ESS_STS_T          sts = 0;
    ESS_OBJDEF_T       Object;
    ESS_HOUTLINE_T     hOutline;
    ESS_HMEMBER_T      hMemberScenario;
    ESS_APPNAME_T      szAppName;
    ESS_DBNAME_T       szDbName;
    ESS_OBJNAME_T      szFileName;

    memset(&Object, '\0', sizeof(Object));
    Object.hCtx = hCtx;
    Object.ObjType = ESS_OBJTYPE_OUTLINE;
    strcpy(szAppName, "Sample");
    strcpy(szDbName, "Basic");
    strcpy(szFileName, "Basic");
    Object.AppName = szAppName;
    Object.DbName = szDbName;
    Object.FileName = szFileName;

    sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE,
          ESS_TRUE, &hOutline);

    if (!sts)
    {
       sts = EssOtlFindMember(hOutline, "Scenario",
       &hMemberScenario);
    }

    if (!sts && hMemberScenario)
    {
       sts = EssOtlDeleteDimension(hOutline,
       hMemberScenario, "Actual");
    }

SeeAlso

EssOtlDeleteMember()
EssOtlAddDimension()
EssOtlAddMember()
EssOtlFindMember()
EssOtlGetMemberInfo()