EssOtlVaryingAssociateAttributeDimension

Associates a base dimension with an attribute dimension and defines the base dimension as having varying attributes. Member attribute associations vary depending on the level-0 members of the given independent dimensions, of types specified in pucIndependentTypes. Continuous independent dimensions must be specified last.

Syntax

ESS_FUNC_M EssOtlVaryingAssociateAttributeDimension (hOutline, hBaseDim, hAttrDim, countOfIndepDims, *pIndepDims, *pucIndependentTypes);
ParameterData TypeDescription

hOutline

ESS_HOUTLINE_T

Outline context handle

hBaseDim

ESS_HMEMBER_T

Base dimension handle

hAttrDim

ESS_HMEMBER_T

Attribute dimension handle

countOfIndepDims

ESS_INT32_T

The number of independent dimensions that control the varying attribute

*pIndepDims

ESS_HMEMBER_T

Pointer to an array of member handles for the independent dimensions

*pucIndependentTypes

ESS_UCHAR_T

Pointer to an array of independent types contained in *pIndepDims.

The independent types supported are:

  • ESS_ASSOCIATE_TYPE_DISCRETE

  • ESS_ASSOCIATE_TYPE_CONTINUOUS

Return Value

Returns 0 if successful.

Example

void TestEssOtlVaryingAssociateAttributeDimenion()
{
	ESS_STS_T	sts = ESS_STS_NOERR;
	ESS_HOUTLINE_T	hOutline = ESS_NULL;
	ESS_OBJDEF_T	Object;
	ESS_HMEMBER_T	hBaseDim = ESS_NULL;
	ESS_HMEMBER_T	IndDimsArray[2];
	ESS_HMEMBER_T	hAttrDimArray[9];
	ESS_INT32_T	countOfIndDims;
	ESS_UCHAR_T	pucIndependentTypes[2];
	int		i;

	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);   

	SetupTest(hOutline);

	/* Assign independent dimension array*/
	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);

	/* Get handles to base and attribute dimensions for test.*/
	sts = EssOtlFindMember(hOutline, "Entities", &hBaseDim);
	printf("\nEssOtlFindMember sts: %d\n", sts);

	sts = EssOtlFindMember(hOutline, "Type", &hAttrDimArray[0]);
	printf("EssOtlFindMember sts: %d\n", sts);
	sts = EssOtlFindMember(hOutline, "FT/PT", &hAttrDimArray[1]);
	printf("EssOtlFindMember sts: %d\n", sts);


	/* Disassociate current association before tests.*/
	for (i = 0; i < 2; i++)
	{
		sts = EssOtlDisassociateAttributeDimension(hOutline, hBaseDim, hAttrDimArray[i]);
		printf("EssOtlDisassociateAttributeDimension sts: %d\n", sts);
	}

	/* Associate the dimension Entities to Type*/
	printf("\nValid case: Associate the dimension Entities and Type:\n");
	countOfIndDims = 2;
	pucIndependentTypes[0] = ESS_ASSOCIATE_TYPE_DISCRETE;
	pucIndependentTypes[1] = ESS_ASSOCIATE_TYPE_CONTINUOUS;
	sts = EssOtlVaryingAssociateAttributeDimension(hOutline, hBaseDim, hAttrDimArray[0], countOfIndDims, IndDimsArray, pucIndependentTypes);
	printf("EssOtlVaryingAssociateAttributeDimension sts: %d\n", sts);

	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