Page 1 of 1

How to Extract Cube data into csv file using TI process

Posted: Thu Sep 17, 2020 3:39 am
by j.calibs
I'm still new to TM1 and I need help to extract data from a cube and save it as csv using TI process.

Re: How to Extract Cube data into csv file using TI process

Posted: Thu Sep 17, 2020 4:11 am
by Alan Kirk
j.calibs wrote: Thu Sep 17, 2020 3:39 am I'm still new to TM1 and I need help to extract data from a cube and save it as csv using TI process.
I would recommend investing in some training. I'm not having a go at you in saying that but this is TM1 101, so if you can't do this you're really going to struggle. There are a lot of consultants which can provide you with excellent training courses.

I'm not going to give you the fish, but I'll teach you how to catch them.
  • Create a view of the data that you want to extract. Save it as a public view. When you get a bit more confident you can do this in code but for now creating it manually is fine. I recommend doing it not through the cube viewer but by right clicking on the cube and using the "Export as text data..." dialog. If you want consolidations in your output make sure that the "Skip Consolidated Values" box is UNCHECKED. NEVER uncheck the Skip Zero / Blank values box (unless you have a very, very small selection of elements), or you will never be heard from again.
  • Create a new process and set the view as its data source.
  • Go to the variables tab. Set everything to a variable type of string and contents of Other.
  • The prolog tab will execute before the data source is opened; normally you could use this to create the source view, but in this case we don't need to.
  • If there is any code in the metadata tab, it will execute once per record. You can use this to add new elements, etc if you're doing an import. In this case you aren't.
  • Any code in the data tab will also execute once per row. Use the AsciiOutput function to write each row to your file. Note that if for whatever reason you have left one of your variable types as numeric, you will need to convert it before you write it (STR function, or NumberToString function) since AsciiOutput will only accept string values.
This is not the optimal way of doing things, but it's quick, dirty, effective and with training will lead you on to greater and more efficient things in due course.

Re: How to Extract Cube data into csv file using TI process

Posted: Wed Sep 23, 2020 5:28 am
by j.calibs
Thank you for your reply! This helps me a lot!

Re: How to Extract Cube data into csv file using TI process

Posted: Thu Sep 24, 2020 7:39 pm
by PavoGa
Alan Kirk wrote: Thu Sep 17, 2020 4:11 am
j.calibs wrote: Thu Sep 17, 2020 3:39 am I'm still new to TM1 and I need help to extract data from a cube and save it as csv using TI process.
I would recommend investing in some training. I'm not having a go at you in saying that but this is TM1 101, so if you can't do this you're really going to struggle. There are a lot of consultants which can provide you with excellent training courses.



This is not the optimal way of doing things, but it's quick, dirty, effective and with training will lead you on to greater and more efficient things in due course.
You're such a softie, Alan.