Question regarding a DB function in my rule

Post Reply
ChrisF79
Posts: 52
Joined: Mon Sep 20, 2010 2:20 pm
OLAP Product: IBM TM1
Version: 9.5.1
Excel Version: 2007 SP2

Question regarding a DB function in my rule

Post 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.
User avatar
rkaif
Community Contributor
Posts: 328
Joined: Fri Sep 05, 2008 6:58 pm
OLAP Product: IBM Cognos TM1
Version: 9.1 or later
Excel Version: 2003 or later

Re: Question regarding a DB function in my rule

Post 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
Cheers!
Rizwan Kaif
Alan Kirk
Site Admin
Posts: 6647
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: Question regarding a DB function in my rule

Post 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.
"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.
Suharsh
Posts: 33
Joined: Mon Apr 09, 2012 8:31 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Re: Question regarding a DB function in my rule

Post 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
Suharsh....
asutcliffe
Regular Participant
Posts: 164
Joined: Tue May 04, 2010 10:49 am
OLAP Product: Cognos TM1
Version: 9.4.1 - 10.1
Excel Version: 2003 and 2007

Re: Question regarding a DB function in my rule

Post 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
Suharsh
Posts: 33
Joined: Mon Apr 09, 2012 8:31 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003

Re: Question regarding a DB function in my rule

Post 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.
Suharsh....
tomok
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: Question regarding a DB function in my rule

Post 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.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Post Reply