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
Dimension Information to DB / Text file
-
- Site Admin
- Posts: 1458
- Joined: Wed May 28, 2008 9:09 am
Re: Dimension Information to DB / Text file
Sure.
ELPARN gives you the number of parents. Use this to loop round and output a row for each parent.
ELPARN gives you the number of parents. Use this to loop round and output a row for each parent.
-
- MVP
- Posts: 1831
- Joined: Mon Dec 05, 2011 11:51 am
- OLAP Product: Cognos TM1
- Version: PA2.0 and most of the old ones
- Excel Version: All of em
- Location: Manchester, United Kingdom
- Contact:
Re: Dimension Information to DB / Text file
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.
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.
Declan Rodger
-
- Posts: 23
- Joined: Fri Aug 19, 2011 6:40 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 14.0.4760.1000
Re: Dimension Information to DB / Text file
Thanks David and declanr. That really worked for me.
Regards,
Priyank
Regards,
Priyank