Exporting TM1 Cube

Post Reply
Abinaya
Posts: 57
Joined: Fri Sep 17, 2010 11:57 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Exporting TM1 Cube

Post by Abinaya »

Hi,
I am exporting a TM1 cube using asciioutput function. Say I have 5 dimensions, I was able to export these 5 dimension into records (Each dimension one instance of an element) in text or CSV file. One of the dimension is measures where elements will be assgined values. Now When I export only one element of the measures dimension is shown up in a record. In another words one element for each record.

How do I export where all the elements of measures dimension can be shown in one record?

Shown here how it should appear

Dim A Dim B Dim C Dim D Dim Measures Element 1, Dim Measures Element 2, Dim Measures Element 3

Customer Year Month State 1000 25.5 30

Another way to describe is how to move the measures elements as header of the file and aslo show the values?

Currently it is showing up like this

Customer Year Month State Dim Measures Element 1 1000
Customer Year Month State Dim Measures Element 2 25.5
Customer Year Month State Dim Measures Element 3 30

Thanks for the help in advance.
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: Exporting TM1 Cube

Post by Alan Kirk »

Abinaya wrote:Hi,
I am exporting a TM1 cube using asciioutput function. Say I have 5 dimensions, I was able to export these 5 dimension into records (Each dimension one instance of an element) in text or CSV file. One of the dimension is measures where elements will be assgined values. Now When I export only one element of the measures dimension is shown up in a record. In another words one element for each record.

How do I export where all the elements of measures dimension can be shown in one record?

Shown here how it should appear

Dim A Dim B Dim C Dim D Dim Measures Element 1, Dim Measures Element 2, Dim Measures Element 3

Customer Year Month State 1000 25.5 30

Another way to describe is how to move the measures elements as header of the file and aslo show the values?

Currently it is showing up like this

Customer Year Month State Dim Measures Element 1 1000
Customer Year Month State Dim Measures Element 2 25.5
Customer Year Month State Dim Measures Element 3 30

Thanks for the help in advance.
What you need to do is this:
- Create a view using one of your measures elements that will always have a value if any of the other elements do. If there isn't one you may need to create an artificial "flag" element using either a rule or another TI process. That will be your data source.
- On the Prolog tab, create a counter variable like l_Rows = 0;
- On the Data tab, increment that counter. ( l_Rows = l_Rows + 1;)
- Have an If() block so that If(l_Rows = 1); then write your heading row using AsciiOutput. That way your heading will be written only on the first row.
- Use CellGetN functions to retrieve your various measures elements values.
- Use AsciiOutput() to do a single output of all of the values that you want to write.

In this way as the Data tab processes each row you'll be manually reading whichever measures values you want to output, and writing them to your file in a single row.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Abinaya
Posts: 57
Joined: Fri Sep 17, 2010 11:57 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Re: Exporting TM1 Cube

Post by Abinaya »

Alan Kirk wrote:
Abinaya wrote:Hi,
I am exporting a TM1 cube using asciioutput function. Say I have 5 dimensions, I was able to export these 5 dimension into records (Each dimension one instance of an element) in text or CSV file. One of the dimension is measures where elements will be assgined values. Now When I export only one element of the measures dimension is shown up in a record. In another words one element for each record.

How do I export where all the elements of measures dimension can be shown in one record?

Shown here how it should appear

Dim A Dim B Dim C Dim D Dim Measures Element 1, Dim Measures Element 2, Dim Measures Element 3

Customer Year Month State 1000 25.5 30

Another way to describe is how to move the measures elements as header of the file and aslo show the values?

Currently it is showing up like this

Customer Year Month State Dim Measures Element 1 1000
Customer Year Month State Dim Measures Element 2 25.5
Customer Year Month State Dim Measures Element 3 30

Thanks for the help in advance.
What you need to do is this:
- Create a view using one of your measures elements that will always have a value if any of the other elements do. If there isn't one you may need to create an artificial "flag" element using either a rule or another TI process. That will be your data source.
- On the Prolog tab, create a counter variable like l_Rows = 0;
- On the Data tab, increment that counter. ( l_Rows = l_Rows + 1;)
- Have an If() block so that If(l_Rows = 1); then write your heading row using AsciiOutput. That way your heading will be written only on the first row.
- Use CellGetN functions to retrieve your various measures elements values.
- Use AsciiOutput() to do a single output of all of the values that you want to write.

In this way as the Data tab processes each row you'll be manually reading whichever measures values you want to output, and writing them to your file in a single row.
Thanks.That worked.
Post Reply