Page 1 of 2
turbo integrator rule
Posted: Mon May 17, 2010 1:09 pm
by angel1234
hi,
i am new to the cognos tm1.
i am trying to create and load a cube using turbo integrator process.within that i have a requirement like the elements within the dimension should be moved dynamically based on certain conditions.the if condition i tried like below .Please
if((dayno(today)-dayno( AttrS(type,storename,'StartDate')) >365) ;
but its not working it showing some error like "syntax error :comma missing "
can anyone help me about this???
thanks and regards
angel
Element Addition and Deletion using Rule Editor
Posted: Mon May 17, 2010 1:38 pm
by monishapm
Hi,
There is an if condition, if this condition is true then an element is to be shifted from one consolidated element to another consolidated element which is in the same dimension.
Can anyone pls tell how to do it using rule editor.
Thanks
Monisha
Re: Element Addition and Deletion using Rule Editor
Posted: Mon May 17, 2010 2:47 pm
by Steve Rowe
Hi Monisha,
This cannot be done in TM1, dimension structures are totally independant of the cubes (and rules) they are used in.
A way of doing this would be to do something like the following.
SourceValue contains the value you want.
ChildA is in the first consolidation
ChildB is in the second consolidation.
Your rules are
ChildA= N: If ( condition is true , SourceValue, 0);
ChildB= N: If ( condition is false, SourceValue, 0);
Feeders
SourceValue=> ChildA, ChildB;
Note that I've missed out most of the syntax!
Another way of doing this would be to handle the problem when the data is entered into the system, probably only practical if it is loaded with a TI process.
HTH
Cheers,
Re: turbo integrator rule
Posted: Tue May 18, 2010 12:39 am
by Martin Ryan
Hi Angel,
I think you're missing a closing parenthesis.
if((dayno(today)-dayno( AttrS(type,storename,'StartDate'))) >365) ;
(I've also moved this post to the correct forum).
Martin
Re: turbo integrator rule
Posted: Tue May 18, 2010 4:45 am
by angel1234
Thank you its worked well

turbo integrator rule condition
Posted: Tue May 18, 2010 5:07 am
by angel1234
hi,
I am trying to shift an element component to another hierarchy if the element start date is greater than 365 days.this condition is not working fine with me(element components were not shifting.TI process completing sucessfully) .Can any one give me suggestions over this??
if(dayno(today)-dayno( AttrS('dim_name','elementname','attributename'))>365) ;
DimensionElementcomponentDelete('dim_name','elementname','elementcomponentname');
DimensionElementcomponentAdd('dim_name','elementname','elementcomponentname',+1);
endif;
Thanks and regards,
angel
Re: Element Addition and Deletion using Rule Editor
Posted: Tue May 18, 2010 5:07 am
by monishapm
Hi,
Actually the description is like this:
Child A is in "New" Consloidation
No elements are there in "Old" Consolidation.
A condition is there which include substraction of start date of "A Company" And Current date. If this value is greater than 366 then Child A is to be shifted from "New" to "Old".
Regards,
Monisha
Re: Element Addition and Deletion using Rule Editor
Posted: Tue May 18, 2010 5:27 am
by Alan Kirk
monishapm wrote:
Actually the description is like this:
Child A is in "New" Consloidation
No elements are there in "Old" Consolidation.
A condition is there which include substraction of start date of "A Company" And Current date. If this value is greater than 366 then Child A is to be shifted from "New" to "Old".
I haven't tested this, but I believe that it would be possible to do that with a rule by including Child A in both the New and Old consolidations, and using the ElWeight rules function to set the value for the element in the appropriate consolidation to either 0 or 1 depending on the result of the condition test.
However, it's not a solution that I particularly like the idea of since it's potentially confusing for someone who is drilling down on the cube to do an ad hoc query.
As Steve said, rules as such can't physically move an element from one consolidation to another... but T.I. can. It can't do it in real time, but if you're only testing whether the start date is > 366 days ago you don't need to. My suggestion would be to create a "housekeeping" process that runs overnight and handles this kind of update, removing the element from the original consolidation (DimensionElementComponentDelete) and adding it to the new one (DimensionElementComponentAdd).
Re: turbo integrator rule condition
Posted: Tue May 18, 2010 6:32 am
by lotsaram
Question 1:
Is your code really exactly as posted? It looks like you are encapsulating your variable names in single quotes, therefore they will be treated as literal strings. Strip out the single quotes or post the actual code to make trouble-shooting possible.
Question 2:
What advanced code tab are you doing this on? DimensionElementComponentAdd and DimensionElementComponentDelete should only be done on either the Prolog or Metadata.
Re: turbo integrator rule condition
Posted: Tue May 18, 2010 7:17 am
by angel1234
hi,
this is my exact code..
if((dayno(today)-dayno( AttrS('storename1',type,'StartDate'))<365)) ;
DimensionElementcomponentDelete('storename1',type,storename);
DimensionElementcomponentAdd('storename1','lfl',storename,+1);
endif;
i am doing it in metadata tab.
storename1 is my dimension,type(element in store dimension) =supermarket,express,lfl(within supermarket,express ,lfl i have many stores like store1,store2... ),startdate is an attribute of the storename
Thanks and regards ,
angel
I am trying to delete an element component 'store1'(say it is in 'express' hierarchy) and trying to paste it in 'lfl' if it is opened before 1 year.
Re: turbo integrator rule condition
Posted: Tue May 18, 2010 8:29 am
by Jeroen Eynikel
I have used the dimensionelementcomponentdelete / add combo a lot in the past and I don't see anything in your code that is obviously wrong.
=> I would start 'debugging' by inserting Asciioutputstatements. Things to check: is your attribute actually in a format that dayno evaluates correctly? That would be my first guess tbh. I.e. is there actually something passing your condition.
Re: turbo integrator rule condition
Posted: Tue May 18, 2010 8:34 am
by Alan Kirk
angel1234 wrote:hi,
this is my exact code..
if((dayno(today)-dayno( AttrS('storename1',type,'StartDate'))<365)) ;
DimensionElementcomponentDelete('storename1',type,storename);
DimensionElementcomponentAdd('storename1','lfl',storename,+1);
endif;
i am doing it in metadata tab.
storename1 is my dimension,type(element in store dimension) =supermarket,express,lfl(within supermarket,express ,lfl i have many stores like store1,store2... ),startdate is an attribute of the storename
Thanks and regards ,
angel
I am trying to delete an element component 'store1'(say it is in 'express' hierarchy) and trying to paste it in 'lfl' if it is opened before 1 year.
Then wouldn't it be >365 rather than <365?
Re: Element Addition and Deletion using Rule Editor
Posted: Tue May 18, 2010 9:05 am
by monishapm
Hi,
I tried using TI process. But its showing error :
"StoreA","1 Quarter","France","1.",Data Source line (1) Error: MetaData procedure line (9): Unable to delete element "StoreA" from consolidation.
Pls tell why its not able to delete??
Regards,
Monisha
Re: Element Addition and Deletion using Rule Editor
Posted: Tue May 18, 2010 9:25 am
by Alan Kirk
monishapm wrote:Hi,
I tried using TI process. But its showing error :
"StoreA","1 Quarter","France","1.",Data Source line (1) Error: MetaData procedure line (9): Unable to delete element "StoreA" from consolidation.
Pls tell why its not able to delete??
With that error message, it'll be because StoreA
isn't part of the consolidation that you've specified. To avoid the error, use the ElIsPar function as the condition of an If() function to determine whether the element still is part of the consolidation. Only use DimensionElementComponentDelete if it is.
Admin Note: I've merged the many and varied threads relating to this topic into one.
Re: Element Addition and Deletion using Rule Editor
Posted: Tue May 18, 2010 10:31 am
by lotsaram
Alan Kirk wrote:Admin Note: I've merged the many and varied threads relating to this topic into one.
That's a relief, until I got to this line I thought I had gone mad.
Re: Element Addition and Deletion using Rule Editor
Posted: Tue May 18, 2010 10:55 am
by Alan Kirk
lotsaram wrote:Alan Kirk wrote:Admin Note: I've merged the many and varied threads relating to this topic into one.
That's a relief, until I got to this line I thought I had gone mad.
Yes, there's little more irritating than to spend the time answering a question, only to find that someone else has answered it when it was asked in a slightly different way two threads down. Better to merge the relevant posts to cut that possibility off at the pass.
Re: turbo integrator rule
Posted: Tue May 18, 2010 11:39 am
by angel1234
hi alan,
but we are trying to implement it in different ways.
thanks and regards,
angel
Re: turbo integrator rule
Posted: Tue May 18, 2010 11:48 am
by angel1234
hi lotsaram,,
i didnt get you what you told about debugging can you please explain me how to do debugging over that.
since my process is compliing sucessfully i am not able to continue the debubbing.
Thanks and regards,
angel
Re: turbo integrator rule
Posted: Tue May 18, 2010 6:33 pm
by Alan Kirk
angel1234 wrote:hi lotsaram,,
i didnt get you what you told about debugging can you please explain me how to do debugging over that.
since my process is compliing sucessfully i am not able to continue the debubbing.
That was Jeroen, not Lotsaram.
TI doesn't have a debugging system as such, so you fudge it by doing AsciiOutputs of your variable values to check that they really are what you think they are. In this case it would involve outputting the result of the expression
dayno( AttrS('storename1',type,'StartDate')) to a text file to ensure that it's really yielding the value that you think it is. (Note that you'll need to convert it to a string first.) As I said in my post, though, I suspect that your main problem is that your comparison operator is the wrong way around.
Re: turbo integrator rule
Posted: Wed May 19, 2010 1:10 am
by angel1234
hi,
can you please tell me is this the correct syntax of ascii output statement??
asciioutput('F:outputext.txt',dayno(attrs('storename1',type,'startdate');
and please tell me in which tab i should write the statement in advanced area.
thanks and regards,
angel