Disassociates the attribute members in the given attribute dimension from the specified base member. The given validity set specifies where the disassociations should occur.
Syntax
ESS_FUNC_M EssOtlVaryingDisassociateAttribute (hOutline, hBaseMember, hAttrDim, mode, pValiditySet);| Parameter | Data Type | Description |
|---|---|---|
hOutline | ESS_HOUTLINE_T | Outline context handle |
hBaseMember | ESS_HMEMBER_T | Base member handle |
hAttrDim | ESS_HMEMBER_T | Attribute member handle |
mode | ESS_INT_T | Association mode. Possible values:
|
pValiditySet | ESS_VALIDITYSET_T | Pointer to the set of independent members where the disassociation occurs |
Notes
This function removes attribute associations from the specified base members.
When a full range is specified, the disassociation is made as specified.
Association mode determines how to handle situations when only the starting tuple is specified instead of a full range. (For these description examples, assume the following associations of members of the Ounces attribute dimension with product 100-10 prior to disassociation):
Jan Feb Mar Apr May 12 12 16 16 12
MODE_OVERWRITE: Disassociation starts from the specified member through all members that follow it. Example: Disassociation starting with Feb.
Result: Associations are removed from Feb and all members after it:
Jan Feb Mar Apr May 12
MODE_NOOVERWRITE: Disassociation starts at the specified tuple and continues until the existing associated attribute member is different. Example: Disassociation starting with Mar.
Result: Since Mar also has attribute 16, both the Apr and Mar associations are removed:
Jan Feb Mar Apr May 12 12 12
MODE_EXTEND: Similar to MODE_NOOVERWRITE except that the association immediately ahead of the start tuple is extended over the disassociated member. Example: Disassociation starting with Mar
Result: The Mar and Apr associations are removed; they assume the association of the previous month, Feb.
Jan Feb Mar Apr May
12 12 12 12 12 Return Value
Returns 0 if successful.
Example
void TestEssOtlVaryingDisassociateAttribute()
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_HOUTLINE_T hOutline = ESS_NULL;
ESS_OBJDEF_T Object;
ESS_HMEMBER_T hBaseMbr, hAttrMbr, hBaseDim, hAttrDim, hIndDim = ESS_NULL;
ESS_INT_T mode;
ESS_VALIDITYSET_T ValiditySet;
ESS_HMEMBER_T IndDimsArray[2];
ESS_HMEMBER_T hIndepMbrsArray[4];
ESS_STR_T IndepMbrsArray[4];
ESS_INT32_T countOfIndDims;
ESS_USHORT_T usValiditySetType;
ESS_UCHAR_T pucIndependentTypes[2];
memset(&Object, '\0', sizeof(Object));
Object.hCtx = hCtx;
Object.ObjType = ESS_OBJTYPE_OUTLINE;
Object.AppName = szAppName;
Object.DbName = szDbName;
Object.FileName = szDbName;
printf("\n");
sts = EssOtlOpenOutline(hCtx, &Object, ESS_TRUE, ESS_TRUE, &hOutline);
printf("EssOtlOpenOutline sts: %ld\n",sts);
/* Disassociate base dimension from attribute dimension before test.*/
printf("\nDisassociate base dimension from attribute dimension before test:");
sts = EssOtlFindMember(hOutline, "Entities", &hBaseDim);
printf("\nEssOtlFindMember sts: %d\n", sts);
sts = EssOtlFindMember(hOutline, "Type", &hAttrDim);
printf("EssOtlFindMember sts: %d\n", sts);
sts = EssOtlDisassociateAttributeDimension(hOutline, hBaseDim, hAttrDim);
printf("EssOtlDisassociateAttributeDimension sts: %d\n", sts);
/* Get handle for base member*/
printf("\nGet handle for base member:\n");
sts = EssOtlFindMember(hOutline, "Doe,Jane", &hBaseMbr);
printf("EssOtlFindMember sts: %d\n", sts);
/* Get handle for indep dimensions*/
printf("\nGet handle for indep dimensions:\n");
sts = EssOtlFindMember(hOutline, "Time Periods", &IndDimsArray[0]);
printf("EssOtlFindMember sts: %d\n", sts);
sts = EssOtlFindMember(hOutline, "Years", &IndDimsArray[1]);
printf("EssOtlFindMember sts: %d\n", sts);
/* Associate the dimension Entities and Type*/
printf("\nAssociate the dimensions:\n");
countOfIndDims = 2;
pucIndependentTypes[0] = ESS_ASSOCIATE_TYPE_DISCRETE;
pucIndependentTypes[1] = ESS_ASSOCIATE_TYPE_CONTINUOUS;
sts = EssOtlVaryingAssociateAttributeDimension(hOutline, hBaseDim, hAttrDim, countOfIndDims, IndDimsArray, pucIndependentTypes);
printf("EssOtlVaryingAssociateAttributeDimension sts: %d\n", sts);
/* Initial valid case with ValiditySetType of member handles*/
printf("\n*** Initial valid case with ValiditySetType of member handles ***\n");
printf("\nGet handle for attribute member:\n");
sts = EssOtlFindMember(hOutline, "Regular", &hAttrMbr);
printf("EssOtlFindMember sts: %d\n", sts);
sts = EssOtlFindMember(hOutline, "Jan", &hIndepMbrsArray[0]);
sts = EssOtlFindMember(hOutline, "FY03", &hIndepMbrsArray[1]);
sts = EssOtlFindMember(hOutline, "Jan", &hIndepMbrsArray[2]);
sts = EssOtlFindMember(hOutline, "FY06", &hIndepMbrsArray[3]);
memset(&ValiditySet, '\0', sizeof(ValiditySet));
ValiditySet.countOfIndepDims = 2;
ValiditySet.usValiditySetType = ESS_VALIDITYSET_TYPE_MBRHDLS;
ValiditySet.countOfIndepRanges = 1;
ValiditySet.pIndepMbrs = hIndepMbrsArray;
printf("\nBefore association:");
usValiditySetType = ESS_VALIDITYSET_TYPE_MBRHDLS;
DisplayVaryingAttributes(hOutline, hBaseMbr, hAttrDim, ESS_NULL, usValiditySetType);
mode = ESS_ASSOCIATE_MODE_NOOVERWRITE;
sts = EssOtlVaryingAssociateAttribute(hOutline, hBaseMbr, hAttrMbr, mode, &ValiditySet);
printf("EssOtlVaryingAssociateAttribute sts: %d\n", sts);
/* Disassociation */
IndepMbrsArray[0]= "";
IndepMbrsArray[1]= "";
IndepMbrsArray[2]= "";
IndepMbrsArray[3]= "";
memset(&ValiditySet, '\0', sizeof(ValiditySet));
ValiditySet.countOfIndepDims = 2;
ValiditySet.usValiditySetType = ESS_VALIDITYSET_TYPE_MBRNAMS;
ValiditySet.countOfIndepRanges = 1;
ValiditySet.pIndepMbrs = IndepMbrsArray;
mode = ESS_DISASSOCIATE_MODE_NOOVERWRITE;
sts = EssOtlVaryingDisassociateAttribute(hOutline, hBaseMbr, hAttrDim, mode, &ValiditySet);
printf("EssOtlVaryingDisassociateAttribute sts: %d\n", sts);
/* Restructure and save outline */
SaveOutline(hOutline);
sts = EssUnlockObject(hCtx, ESS_OBJTYPE_OUTLINE, Object.AppName, Object.DbName, Object.FileName);
printf("\nEssUnlockObject sts: %d\n", sts);
sts = EssOtlCloseOutline(hOutline);
printf("EssOtlCloseOutline sts: %d\n",sts);
}See Also