TM1- TI for sending cube data to sql table
-
- Posts: 11
- Joined: Wed Aug 13, 2014 8:35 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: 2010
TM1- TI for sending cube data to sql table
Hello,I have to integrate my tm1 cube data to a sql table through ti. I had made a ti using the odbcopen and close commands and insert command in the data tab.My records were going into the table, but one issue was coming that the elements that used to get hide when suppresszero was selected were not going to the table even though if i had not slected the suppress zero problem So to overcome this, i used viewskipextractzero function in the metadata tab.After adding this, all my elements are coming, but the time for the ti to run is taking long due to large noof records. so if someone can tell me a better method and some thing on how to optimize it.
-
- Regular Participant
- Posts: 424
- Joined: Sat Mar 10, 2012 1:03 pm
- OLAP Product: IBM TM1, Planning Analytics, P
- Version: PAW 2.0.8
- Excel Version: 2019
Re: TM1- TI for sending cube data to sql table
Hi Shivangi,Could you please try ViewExtractSkipZeroesSet in Prolog tab and see the result.Thanks
"You Never Fail Until You Stop Trying......"
-
- Posts: 11
- Joined: Wed Aug 13, 2014 8:35 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: 2010
Re: TM1- TI for sending cube data to sql table
hey i tried the function on the prolog tab, but the ti stops responding that is it gets hanged after 15 mins, my records are around 4- 5 croesBariAbdul wrote:Hi Shivangi,Could you please try ViewExtractSkipZeroesSet in Prolog tab and see the result.Thanks
-
- 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: TM1- TI for sending cube data to sql table
I suggest that you post your exact code, along with specifics of how you have defined the cube view that you're using as your source. It's not at all clear from your posting whether you're turning suppress zeroes on or off but Bari Abdul is correct; if you change that setting you do it in the Prolog (which is executed before any of the data rows are and will therefore affect how many rows you receive), not the later tabs.shivangi wrote:hey i tried the function on the prolog tab, but the ti stops responding that is it gets hanged after 15 mins, my records are around 4- 5 croesBariAbdul wrote:Hi Shivangi,Could you please try ViewExtractSkipZeroesSet in Prolog tab and see the result.Thanks
You should be aware that you should (almost) always skip zeroes when processing a view from a cube, otherwise it is very easy for the number of records to rapidly run to millions, and even billions. If you fail to suppress zeroes then the TI will have to process the number of N elements in the first dimension * the number of N elements in the second * the number of N elements in the third * the number of N elements in the fourth dimension and so on. You can do the maths for yourself on that one, and will probably come up with a fairly scary number.
If your problem is that:
(a) You have values in your SQL table from previous data; and
(b) You need TM1 to reset those values to 0,
including zeroes in the view isn't the way to go about that. Instead you should clear ALL of the data in the SQL table that's being affected first so that you have a blank slate, then export the new values straight from TM1.
This is the same principle as when you update a TM1 cube. You don't write zeroes into the cube, but instead zero out the whole area affected, then load the non-zero values.
"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.
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
-
- MVP
- Posts: 1828
- 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: TM1- TI for sending cube data to sql table
On a general note I've always found multiple ODBC outputs to be slow, if you can ASCII it into a csv in your data tab then in the epilog do a single odbcoutput to action a bulk insert of your csv into the table.
Declan Rodger
-
- Posts: 11
- Joined: Wed Aug 13, 2014 8:35 am
- OLAP Product: TM1
- Version: 10.1.1
- Excel Version: 2010
Re: TM1- TI for sending cube data to sql table
Hello Alan, thanks for the reply.Alan Kirk wrote:I suggest that you post your exact code, along with specifics of how you have defined the cube view that you're using as your source. It's not at all clear from your posting whether you're turning suppress zeroes on or off but Bari Abdul is correct; if you change that setting you do it in the Prolog (which is executed before any of the data rows are and will therefore affect how many rows you receive), not the later tabs.shivangi wrote:hey i tried the function on the prolog tab, but the ti stops responding that is it gets hanged after 15 mins, my records are around 4- 5 croesBariAbdul wrote:Hi Shivangi,Could you please try ViewExtractSkipZeroesSet in Prolog tab and see the result.Thanks
You should be aware that you should (almost) always skip zeroes when processing a view from a cube, otherwise it is very easy for the number of records to rapidly run to millions, and even billions. If you fail to suppress zeroes then the TI will have to process the number of N elements in the first dimension * the number of N elements in the second * the number of N elements in the third * the number of N elements in the fourth dimension and so on. You can do the maths for yourself on that one, and will probably come up with a fairly scary number.
If your problem is that:
(a) You have values in your SQL table from previous data; and
(b) You need TM1 to reset those values to 0,
including zeroes in the view isn't the way to go about that. Instead you should clear ALL of the data in the SQL table that's being affected first so that you have a blank slate, then export the new values straight from TM1.
This is the same principle as when you update a TM1 cube. You don't write zeroes into the cube, but instead zero out the whole area affected, then load the non-zero values.
Basically my cube is a one year model wherein after every new fiscal year, previous fiscal year values are discared. This activity is sort of a backup of the previous data, so we want all the measure elements whether they have value 0 or no to be captured in our database. Right now, my view is based on 4 dims, 1 measure(cube also has the same dims). I have not selected the suppress zero option while i had saved my view.But when i had created my TI , some of my elements were not flowing , which on troubleshooting i founded out that they are invisible when suppress zero is selected. so for that i used the following steps :
1) connected the data source as my view
2) in the variable tab, for the 5 parameters defined type as other
3) in d advanced tab: prolog:
#****Begin: Generated Statements***
#****End: Generated Statements****
ODBCOpen('RSV_Baan_1415_test','ssis_plng','admin123');
ViewExtractSkipZeroesSet('1_RSV','RSV_cube_db', 0);
in data :
#****Begin: Generated Statements***
#****End: Generated Statements****
sql='INSERT INTO rsv_cube_tm1(V1,h_location,t_period,V4,Value) values('''|V1|''','''|h_location|''','''|t_period|''','''|V4|''', '''|Value|''')';
ODBCoutput('RSV_Baan_1415_test',sql);
in epilog:
#****Begin: Generated Statements***
#****End: Generated Statements****
ODBCClose('RSV_Baan_1414_test');
i added the viewskip in prolog after suugestion from brian,but it didnthelp caus my ti got hanged in between and was not responding. I hope this will be sufficient for you to analyze.
-
- MVP
- Posts: 2836
- Joined: Tue Feb 16, 2010 2:39 pm
- OLAP Product: TM1, Palo
- Version: Beginning of time thru 10.2
- Excel Version: 2003-2007-2010-2013
- Location: Atlanta, GA
- Contact:
Re: TM1- TI for sending cube data to sql table
A ridiculous requirement, IMO. As Alan explained, processing all intersections in even a moderate size cube can run into the millions of records. This is never going to be a viable solution using ODBCOutput. If you insist on exporting all the zeros you'll need to make it a two step process by exporting as a CSV (using ASCIIOUtout) and then have an external (meaning outside of TM1) job to pick that file up and import into the SQL table.shivangi wrote:This activity is sort of a backup of the previous data, so we want all the measure elements whether they have value 0 or no to be captured in our database.
-
- Posts: 78
- Joined: Tue Mar 18, 2014 8:02 am
- OLAP Product: TM1, Cognos Express
- Version: 10.2.2
- Excel Version: 2013
Re: TM1- TI for sending cube data to sql table
If values are disappearing when you skip zeros there is something wrong with your feeders. Fix this and then please enable zero suppression in your TI.
- paulsimon
- MVP
- Posts: 808
- Joined: Sat Sep 03, 2011 11:10 pm
- OLAP Product: TM1
- Version: PA 2.0.5
- Excel Version: 2016
- Contact:
Re: TM1- TI for sending cube data to sql table
Hi
I tend to agree that the requirement to include zeroes does not make sense.
If you want a backup of your TM1 cube as year end the simplest way is to simply do a SaveData and copy the files in the DatabaseDirectory.
If you do have to back it up to SQL then as suggested, output to CSV and use a BulkInsert.
If you really do need to output zeroes, first ensure that you are suppressing consolidations, since I would guess that you only need to output data for base level elements in each dim.
I would suggest that you output with zero suppression and then manufacture the zeroes in SQL as follows:
Output the elements in each dimension to different tables
In SQL construct a Cartesian Product of all the dimensions. Select from this and Insert into the database. Then update the rows from the table that has the zero suppression. Alternatively do a set division so you only write 0s for rows that don't have non-zero values.
If with your relatively small cube of only 4 dimensions you will probably have far more zeroes than data values
Regards
Paul Simon
I tend to agree that the requirement to include zeroes does not make sense.
If you want a backup of your TM1 cube as year end the simplest way is to simply do a SaveData and copy the files in the DatabaseDirectory.
If you do have to back it up to SQL then as suggested, output to CSV and use a BulkInsert.
If you really do need to output zeroes, first ensure that you are suppressing consolidations, since I would guess that you only need to output data for base level elements in each dim.
I would suggest that you output with zero suppression and then manufacture the zeroes in SQL as follows:
Output the elements in each dimension to different tables
In SQL construct a Cartesian Product of all the dimensions. Select from this and Insert into the database. Then update the rows from the table that has the zero suppression. Alternatively do a set division so you only write 0s for rows that don't have non-zero values.
If with your relatively small cube of only 4 dimensions you will probably have far more zeroes than data values
Regards
Paul Simon