Page 1 of 1

Dimension Information to DB / Text file

Posted: Sun Jun 10, 2012 1:48 am
by pmathur
Hi All,

I have a requirement where I want to store dimension's level by level information into DB / text file.

For Example :

A --> B --> C
A --> B --> D
A --> E --> F
A --> G --> B --> C
A --> H --> E

The structure should be like : Level1 --> Level2 --> Level3 --> Level n

We want to achieve this via TI process.

To accomplish this I have used ELPAR function in Data tab, but the problem encounter when a single element falls in different hierarchies. For example(as per above example):
when i insert the element "C" into DB/text file what i got is this (A --> B --> C). But we also want a row in DB for this entry (A --> G --> B --> C).

Is there any way by which we can override the distinct element selection feature, so that for a single element which occurs in multiple hierarchy, we can have multiple rows in DB table?

We tried using dimension subset at both leaf and All level.

Can anyone please help me out from this situation.

Thanks in advance and I appreciate your valuable time and contribution.

Regards,
Priyank

Re: Dimension Information to DB / Text file

Posted: Sun Jun 10, 2012 10:24 am
by David Usherwood
Sure.
ELPARN gives you the number of parents. Use this to loop round and output a row for each parent.

Re: Dimension Information to DB / Text file

Posted: Sun Jun 10, 2012 10:25 am
by declanr
You will just need to build a while loop into your TI.

ElParN() will give you the number of loops that you want to complete for each element.

It is worth noting that (assuming any level can have multiple parents) you will need to nest while loops within each other but the concecpt will be exactly the same just using a different variable.

e.g.

iMax = ElParN( sDim, v1);
iCount = 1;

While ( iCount <= iMax );
sPar1 = ElPar ( sDim, v1, iCount );
iMax2 = ElParN ( sDim, sPar1 );
iCount2 = 1;
While ( iCount2 <= iMax2 );
sPar2 = Elpar ( sDim, sPar1, iCount2 );
iMax3 = ElparN ( sDim, sPar2 );
iCount3 = 1;


And so on and so forth.

Re: Dimension Information to DB / Text file

Posted: Mon Jun 11, 2012 4:19 am
by pmathur
Thanks David and declanr. That really worked for me.

Regards,
Priyank