# EssOtlAddAliasCombination

Description

EssOtlAddAliasCombination() adds an alias combination to a member for a single alias table.

Syntax

    ESS_FUNC_M EssOtlAddAliasCombination (hOutline, hMember, pszAliasTable, pszAlias, pszCombination);

ESS_HOUTLINE_T | hOutline
ESS_HMEMBER_T | hMember
ESS_STR_T | pszAliasTable
ESS_STR_T | pszAlias
ESS_STR_T | pszCombination

Parameters

hOutline | Outline context handle.
hMember | Handle of member to create an alias combination for.
pszAliasTable | Alias table to add the combination to. If this parameter is ESS_NULL, the default alias table is used.
pszAlias | Alias
pszCombination | Member combination to associate with the alias. This can be a cross-dimensional member list.

Return Value

Returns 0 if successful; otherwise one of the following:

OTLAPI_BAD_ALIASTABLE
OTLAPI_ERR_ALIASSHARED
OTLAPI_ERR_ILLEGALCOMBOALIAS
OTLAPI_ERR_ILLEGALALIASSTRING
OTLAPI_ERR_DUPLICATEALIAS

Notes

- The member handle cannot be a shared member. Aliases are not allowed for shared members.

Example

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

    ESS_STS_T          sts = 0;
    ESS_OBJDEF_T       Object;
    ESS_HOUTLINE_T     hOutline;
    ESS_HMEMBER_T      hMemberJan;
    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, "Jan",
             &hMemberJan);
    }
    if (!sts && hMemberJan)
       sts = EssOtlAddAliasCombination(hOutline,
             hMemberJan, ESS_NULL,
             "Alias Combination",
             "Measures->Jan");
    }

See Also

EssOtlDeleteAliasCombination()
EssOtlGetNextAliasCombination()