Page 1 of 1
Question regarding a DB function in my rule
Posted: Thu Sep 23, 2010 6:44 pm
by ChrisF79
I've inherited a rule that says,
Code: Select all
IF ( (ELLEV('QAD Sites - Locations',!QAD Sites - Locations) >0) & (!QAD Entities @= '5000'),
DB('QAD Inventory',!QAD Entities,!QADInventoryCostSets,!QADInventoryBuyers,!QADInventoryStatus,!QADInventoryType,!ItemNumbers,!InventoryMethods,!QADProductLines,'5000 - P001 - 1',!QADSuppliers,!Team,!QADInventoryMeasures),STET)
What exactly is this doing? I don't understand what the ! is in the IF statement or the DB.
Re: Question regarding a DB function in my rule
Posted: Thu Sep 23, 2010 7:34 pm
by rkaif
DB() is a Rule function in TM1 which is used to return a value from a cube.
! (exclamation sign) can be used before the dimension name to get all the element names within that dimension.
For example if your Time dimension has elements 2008, 2009 and 2010 then within your rule you can say !Time which will make the rule applicable to all the elements in the time dimension.
Hope that helps,
Rizwan Kaif
Re: Question regarding a DB function in my rule
Posted: Thu Sep 23, 2010 9:45 pm
by Alan Kirk
ChrisF79 wrote:I've inherited a rule that says,
Code: Select all
IF ( (ELLEV('QAD Sites - Locations',!QAD Sites - Locations) >0) & (!QAD Entities @= '5000'),
DB('QAD Inventory',!QAD Entities,!QADInventoryCostSets,!QADInventoryBuyers,!QADInventoryStatus,!QADInventoryType,!ItemNumbers,!InventoryMethods,!QADProductLines,'5000 - P001 - 1',!QADSuppliers,!Team,!QADInventoryMeasures),STET)
What exactly is this doing? I don't understand what the ! is in the IF statement or the DB.
From the TM1 Rules Guide:
The name of the appropriate dimension preceded by an exclamation mark (!). This is called variable notation, which indicates that the reference applies to the element in the external cube that corresponds to the value currently being requested. For example, if a DB function is used in a formula that calculates a value for Belgium, the argument !Region resolves to Belgium.
Re: Question regarding a DB function in my rule
Posted: Wed Aug 29, 2012 8:54 pm
by Suharsh
@Alan,
Thanks for the information below. But I have a question. We are saying that an "!Year" refers to all the elements in the year dimension.
Then How does TM1 parse the cube cells which has rules applied to them. I mean to say, just as Turbo integrator parses the data row by row. How does TM1 parse the cells which has rules on them?
Also Using an Exclamation sign allows referencing a consolidated element in that dimension as well?
Thanks
Re: Question regarding a DB function in my rule
Posted: Wed Aug 29, 2012 9:17 pm
by asutcliffe
Alan Kirk wrote:
From the TM1 Rules Guide:
The name of the appropriate dimension preceded by an exclamation mark (!). This is called variable notation, which indicates that the reference applies to the element in the external cube that corresponds to the value currently being requested. For example, if a DB function is used in a formula that calculates a value for Belgium, the argument !Region resolves to Belgium.
Hi
I don't think I can improve on Alan's answer really.
However I like to think of it as the "!" notation returning the name of the
element of the named
dimension that the rule is being applied to.
By the way, this is kinda the same question you asked over here -
http://www.tm1forum.com/viewtopic.php?f=3&t=6834 - so someone is probably going to suggest you read the "requests for assistance guidelines" soon -
http://www.tm1forum.com/viewtopic.php?f=3&t=1037
Re: Question regarding a DB function in my rule
Posted: Thu Aug 30, 2012 5:42 am
by Suharsh
Hi,
Thanks for the reply. Yes, I did post a similar question there, as I later realized that this is a better thread to get this question answered.
Re: Question regarding a DB function in my rule
Posted: Thu Aug 30, 2012 11:40 am
by tomok
Sukhen Sharma wrote:We are saying that an "!Year" refers to all the elements in the year dimension.
Then How does TM1 parse the cube cells which has rules applied to them. I mean to say, just as Turbo integrator parses the data row by row. How does TM1 parse the cells which has rules on them?
In this case the !Year actually means all the elements in the Year dimension
that are included in the area of the cube indicated in the left hand side of the rule statement.