Writing rule in sparsed cube

Post Reply
User avatar
ioscat
Regular Participant
Posts: 209
Joined: Tue Jul 10, 2012 8:26 am
OLAP Product: Contributor
Version: 9.5.2 10.1.1 10.2
Excel Version: 07+10+13
Contact:

Writing rule in sparsed cube

Post by ioscat »

Hello, community.

As far as i know it's not possible to put ATRRS or DB in left part of any rule.

Code: Select all

['Company Name 001', DB(<...>,!Company Name, 'City')]=N:...
Let the test cube have just two not small dimensions - 'Company Name' and 'City'. Let in one city there are just only few companies, so we can build matrix of cities/companies (let it is named 'The Matrix' and it is sparsely filled by number '1').
If we need to calculate something for company we have to write partitioning IF rule:

Code: Select all

[]=N: IF(DB('The Matrix', !COmpany Name, !City)=1,<...the rule...>,0);
Is there any other way write the rule?

Upd. one other way is to multiply by DB('The Matrix',...) that is 1 or 0
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Writing rule in sparsed cube

Post by declanr »

ioscat wrote:

Code: Select all

[]=N: IF(DB('The Matrix', !COmpany Name, !City)=1,<...the rule...>,0);
Just one quick pointer is that if it is going to be seriously sparse in the sense that most of your results will be derived from the "ELSE" part of your IF statement I would change it to be a STET instead of a 0 and then make sure people can't change it by implementing security:

Code: Select all

[]=N: IF(DB('The Matrix', !COmpany Name, !City)=1,<...the rule...>,STET);
Declan Rodger
Duncan P
MVP
Posts: 600
Joined: Wed Aug 17, 2011 1:19 pm
OLAP Product: TM1
Version: 9.5.2 10.1 10.2
Excel Version: 2003 2007
Location: York, UK

Re: Writing rule in sparsed cube

Post by Duncan P »

Why?
declanr
MVP
Posts: 1831
Joined: Mon Dec 05, 2011 11:51 am
OLAP Product: Cognos TM1
Version: PA2.0 and most of the old ones
Excel Version: All of em
Location: Manchester, United Kingdom
Contact:

Re: Writing rule in sparsed cube

Post by declanr »

Duncan P wrote:Why?
I am assuming this was directed towards my comment? If not then feel free to all ignore this comment otherwise:

Build 2 identical 2-d cubes with 2000 elements in d_test_dim (mixture of N and C) and 1 element in d_test_measures

Apply the following rules:

Cube A:

Code: Select all

[]=N: 0;
Cube B:

Code: Select all

[]=N: STET;
You will see a higher memory usage in Cube A than Cube B.
Declan Rodger
Post Reply