Hi,
Its been about 12 months since I have worked with TM1 and I am a little rusty.
We need a TI process to create the subset for a few dimensions we are loading data to based on the elements contained in the file, then zero out only these elements.
2 ways that I know to create the subsets is to:
1. In the prolog call a 2nd TI process to create the elements based on the data contained in the file.
2. Create a loop in the prolog for each dimension
We are loading data containing approx 100k rows.
What is the best way to do this?
Also does anyone have an example of how to create this loop in the prolog?
I can't quite remember how to.
Thanks in advance.
TI help: Subset based on elements in the data source
-
- MVP
- Posts: 3706
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: TI help: Subset based on elements in the data source
And how exactly might a (while) loop in the Prolog help you to compile a list of elements from an external file?
- Martin Ryan
- Site Admin
- Posts: 2003
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: TI help: Subset based on elements in the data source
I think you can zero out in the epilog, though I've never actually tried.
So you could use the data tab to build your subset then use that subset in the epilog along with ViewCreate and ViewZeroOut to do the clear that way.
But to answer your specific question (though I'm also confused as to how that'll help in this situation) in order to do a while loop in the prolog you need to do something like this
Martin
So you could use the data tab to build your subset then use that subset in the epilog along with ViewCreate and ViewZeroOut to do the clear that way.
But to answer your specific question (though I'm also confused as to how that'll help in this situation) in order to do a while loop in the prolog you need to do something like this
Code: Select all
i=0;
while(i<1000);
do Whatever;
i=i+1;
end;
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Jodi Ryan Family Lawyer
-
- Posts: 33
- Joined: Tue Jan 29, 2013 2:52 pm
- OLAP Product: TM1
- Version: 9.0 SP3 9.5.1 10.1.1
- Excel Version: excel 2010 2007 2003
Re: TI help: Subset based on elements in the data source
Hello Jeml,
Like all these things there are often more than a few ways to complete what you are trying to acheive.
If your subset is going be derived from the source file, then you might be better advised to put the code in the metadata tab so that you can affect a change for each record that is contained on the file. I think this is the loop that you are looking for.
In general, I would start with a 'SubsetDeleteAllElements' in your prolog. This gives you an empty starting point
In the metadata, I would use a 'SubsetElementInsert' to insert the neccesary elements.
In the epilog, I would create the view 'ViewCreate' based on your subsets using 'ViewSubsetAssign' and zero it out with 'ViewZeroOut'.
You could take any of those commands and look on the IBM website and you can find the exact syntax plus get a whole host of other metadata commands that will almost certainly cure you of your rustyness. You could for example find the syntax for totally removing these subsets and views so that users are not able to view them after the process. Whilst you are there, look up the 'While' command and you will see how to create loops.
Hope this helps
-Chris
Like all these things there are often more than a few ways to complete what you are trying to acheive.
If your subset is going be derived from the source file, then you might be better advised to put the code in the metadata tab so that you can affect a change for each record that is contained on the file. I think this is the loop that you are looking for.
In general, I would start with a 'SubsetDeleteAllElements' in your prolog. This gives you an empty starting point
In the metadata, I would use a 'SubsetElementInsert' to insert the neccesary elements.
In the epilog, I would create the view 'ViewCreate' based on your subsets using 'ViewSubsetAssign' and zero it out with 'ViewZeroOut'.
You could take any of those commands and look on the IBM website and you can find the exact syntax plus get a whole host of other metadata commands that will almost certainly cure you of your rustyness. You could for example find the syntax for totally removing these subsets and views so that users are not able to view them after the process. Whilst you are there, look up the 'While' command and you will see how to create loops.
Hope this helps
-Chris
-
- MVP
- Posts: 3241
- Joined: Mon Dec 29, 2008 6:26 pm
- OLAP Product: TM1, Jedox
- Version: PAL 2.1.5
- Excel Version: Microsoft 365
- Location: Brussels, Belgium
- Contact:
Re: TI help: Subset based on elements in the data source
Hello there
I would use the Metadata tab to fill the subset, and do the zero out part in the Data tab.
Use a counter to make sure that the zero out part is only done once (at the very beginning).
Set your counter equal to 0 in the Prolog tab. In the Data tab, augment each record with 1.
When the counter equals 1 (use an IF test), do your zero out stuff.
After that (and still in the Data tab), you can load again onto the cube in question.
I would use the Metadata tab to fill the subset, and do the zero out part in the Data tab.
Use a counter to make sure that the zero out part is only done once (at the very beginning).
Set your counter equal to 0 in the Prolog tab. In the Data tab, augment each record with 1.
When the counter equals 1 (use an IF test), do your zero out stuff.
After that (and still in the Data tab), you can load again onto the cube in question.
Best regards,
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
-
- 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: TI help: Subset based on elements in the data source
Maybe I'm not seeing something here but if you have all the elements you need to zero out the affected portions of the cube in the source file, why create a subset at all? Just do a CellPutN of 0 to the affected cells.