Page 1 of 1

Writing rule in sparsed cube

Posted: Mon Mar 25, 2013 10:20 am
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

Re: Writing rule in sparsed cube

Posted: Mon Mar 25, 2013 10:38 am
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);

Re: Writing rule in sparsed cube

Posted: Mon Mar 25, 2013 2:57 pm
by Duncan P
Why?

Re: Writing rule in sparsed cube

Posted: Mon Mar 25, 2013 3:43 pm
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.