Wel want to clear out the rule for a particular cube during run time, so that we can run a process to import data into the cube and then only load back the rule after the process has completed importing the data.
We try to do this by loading an empty text file using RuleLoadFromFile('TestCube', 'E:\Empty Rule.txt');
However this does not clear out the rule and on cancelling the process and checking , the rule still is intact as it was...any ideas why or ideas on other ways of clearing out a rule in a process.
ADMIN NOTE : Move to the correct forum from Useful code...
Clearing Out Rules during Run Time
-
- Posts: 1
- Joined: Fri Oct 14, 2011 8:47 pm
- OLAP Product: TM1
- Version: 9.11
- Excel Version: 2010
-
- Community Contributor
- Posts: 349
- Joined: Tue Aug 17, 2010 6:31 am
- OLAP Product: Planning Analytics
- Version: 2.0.5
- Excel Version: 2016
Re: Clearing Out Rules during Run Time
Is there a performance increase for not having a rule attached to a cube during data load?
-
- MVP
- Posts: 263
- Joined: Fri Jun 27, 2008 12:15 am
- OLAP Product: Cognos TM1, CX
- Version: 9.0 and up
- Excel Version: 2007 and up
Re: Clearing Out Rules during Run Time
Hi Alex
The way you describe it should work and I don't know of another way in TI (at least) that would clear the rule.
Just a few thoughts:
Do you have a ProcessBreak; somewhere before the RuleLoadFromFile that might get hit.
Does the 'E:\Empty Rule.txt' exist in that path? Sorry, it's the old "Is your computer plugged in" but just checking. I haven't tried what happens if the file does not exist.
Is there a blb file for the rule? If yes, delete it.
Another point: if you do use RuleLoadFromFile it can be of advantage to have (only) the Skipcheck; and Feeders; statement in it. Maybe not so well known, but an empty rule file still turns the Sparse Consolidation Algorithm off.
And, yes, performance can be quite different if you 'unload' the rules before a load. Especially if what you are loading to is feeding something else.
Cheers
The way you describe it should work and I don't know of another way in TI (at least) that would clear the rule.
Just a few thoughts:
Do you have a ProcessBreak; somewhere before the RuleLoadFromFile that might get hit.
Does the 'E:\Empty Rule.txt' exist in that path? Sorry, it's the old "Is your computer plugged in" but just checking. I haven't tried what happens if the file does not exist.
Is there a blb file for the rule? If yes, delete it.
Another point: if you do use RuleLoadFromFile it can be of advantage to have (only) the Skipcheck; and Feeders; statement in it. Maybe not so well known, but an empty rule file still turns the Sparse Consolidation Algorithm off.
And, yes, performance can be quite different if you 'unload' the rules before a load. Especially if what you are loading to is feeding something else.
Cheers
-
- MVP
- Posts: 3703
- Joined: Fri Mar 13, 2009 11:14 am
- OLAP Product: TableManager1
- Version: PA 2.0.x
- Excel Version: Office 365
- Location: Switzerland
Re: Clearing Out Rules during Run Time
As Gregor said this should work as you describe. Can you elaborate on what you mean by cancelling the process? Probably if you cancel the process it will initiate a rollback to restore everything to the state prior to running the process and this is why you see the rule file intact. Have you tried running a process with only one line in the prolog for the RuleLoadFromFile. (Also as Gregor said it's best practice for the empty rule not to be totally blank but to contain a single line ="SKIPCHECK;")alex.odago wrote:Wel want to clear out the rule for a particular cube during run time, so that we can run a process to import data into the cube and then only load back the rule after the process has completed importing the data.
We try to do this by loading an empty text file using RuleLoadFromFile('TestCube', 'E:\Empty Rule.txt');
However this does not clear out the rule and on cancelling the process and checking , the rule still is intact as it was...any ideas why or ideas on other ways of clearing out a rule in a process.
It depends. In some cases the performance difference can be monumental, in others barely noticeable. The performance difference (I believe) comes mainly from the overhead of incoming data firing feeders. Note there is always a trade-off between the time saving from loading the data quicker versus the penalty of the time taken to reattach the rules and process feeders. In some cases it is definitely worthwhile due to overall time saving even with reattaching the rule.PlanningDev wrote:Is there a performance increase for not having a rule attached to a cube during data load?
-
- Site Admin
- Posts: 1458
- Joined: Wed May 28, 2008 9:09 am
Re: Clearing Out Rules during Run Time
I use a somewhat different approach to get the same result. I load my data into a measure which does not fire feeders, then copy it across to the fed area in batches. The load runs quickly and I can control the amount I copy, the time it takes and the size the server grows to. (If I loaded all the data across and fully calculated the model the TM1 server would blow my 400gig physical server
)

-
- Posts: 42
- Joined: Mon May 19, 2008 10:25 am
- OLAP Product: TM1, EV
- Version: 9.0 9.1 9.4 9.5 10.1 10.2
- Excel Version: 2003 2007 2010 2015
- Location: London, UK
Re: Clearing Out Rules during Run Time
Size isn't everything !
I do something similar - clearing out multiple rule files, and rewriting the rules ( and inter-cube feeders ) again based on an Excel spreadsheet loaded into a Data Warehouse, via a cube that holds dimensional mappings
For your problem, I'd start with the blb scenario first
Anthony
I do something similar - clearing out multiple rule files, and rewriting the rules ( and inter-cube feeders ) again based on an Excel spreadsheet loaded into a Data Warehouse, via a cube that holds dimensional mappings
For your problem, I'd start with the blb scenario first
Anthony
Anthony
That's no moon - that's a space station
That's no moon - that's a space station