turbo integrator rule

angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

turbo integrator rule

Post 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
monishapm
Posts: 13
Joined: Mon May 17, 2010 10:10 am
OLAP Product: TM1
Version: 9.5
Excel Version: 2007

Element Addition and Deletion using Rule Editor

Post 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
User avatar
Steve Rowe
Site Admin
Posts: 2464
Joined: Wed May 14, 2008 4:25 pm
OLAP Product: TM1
Version: TM1 v6,v7,v8,v9,v10,v11+PAW
Excel Version: Nearly all of them

Re: Element Addition and Deletion using Rule Editor

Post 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,
Technical Director
www.infocat.co.uk
User avatar
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: turbo integrator rule

Post 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
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
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post by angel1234 »

Thank you its worked well :)
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

turbo integrator rule condition

Post 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
monishapm
Posts: 13
Joined: Mon May 17, 2010 10:10 am
OLAP Product: TM1
Version: 9.5
Excel Version: 2007

Re: Element Addition and Deletion using Rule Editor

Post 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
Alan Kirk
Site Admin
Posts: 6667
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: Element Addition and Deletion using Rule Editor

Post 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).
"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.
lotsaram
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: turbo integrator rule condition

Post 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.
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule condition

Post 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.
Jeroen Eynikel
Community Contributor
Posts: 139
Joined: Mon Sep 15, 2008 1:45 pm

Re: turbo integrator rule condition

Post 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.
Alan Kirk
Site Admin
Posts: 6667
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: turbo integrator rule condition

Post 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?
"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.
monishapm
Posts: 13
Joined: Mon May 17, 2010 10:10 am
OLAP Product: TM1
Version: 9.5
Excel Version: 2007

Re: Element Addition and Deletion using Rule Editor

Post 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
Alan Kirk
Site Admin
Posts: 6667
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: Element Addition and Deletion using Rule Editor

Post 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.
"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.
lotsaram
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: Element Addition and Deletion using Rule Editor

Post 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.
Alan Kirk
Site Admin
Posts: 6667
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: Element Addition and Deletion using Rule Editor

Post 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.
"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.
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post by angel1234 »

hi alan,
but we are trying to implement it in different ways. :)

thanks and regards,
angel
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post 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
Alan Kirk
Site Admin
Posts: 6667
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: turbo integrator rule

Post 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.
"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.
angel1234
Posts: 44
Joined: Mon May 17, 2010 8:14 am
OLAP Product: tm1 cognos
Version: 9.5
Excel Version: 2007

Re: turbo integrator rule

Post 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
Post Reply