RULES: Copying ALL measures from cube to aother

Post Reply
mnasra
Posts: 136
Joined: Tue Aug 10, 2010 5:40 pm
OLAP Product: Planning Analytics
Version: 2.0
Excel Version: EXCEL 2013

RULES: Copying ALL measures from cube to aother

Post by mnasra »

Hi Experts,

I have a cube for data entry- (some measures are Simple some are String)
I create a second cube with different dimensions- But same Measures-
FOr some reason- I cannot copy the String and the Numeric elements (it is either one or the other)...

here is the latest version of the rules:

['Actual' ] = N: if(dtype('DIM_Measure', !dim_Measure)@='N',
DB(Cube1, dime1 , !Dim_Measure), Continue);

['Actual' ] = S: if(dtype('DIM_Measure', !dim_Measure)@='S',
DB(Cube1, dime1 , !Dim_Measure), Continue);
Thanks
Micheline
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: RULES: Copying ALL measures from cube to aother

Post by rmackenzie »

You say that the dimensions in Cube1 and Cube2 are different. I am assuming the rules you posted are in Cube2; does the dime1 dimension exist in Cube1? If not, you can't use it in the DB() formula. You would have to reference an actual element names in the dimensions in Cube1.
Robin Mackenzie
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: RULES: Copying ALL measures from cube to aother

Post by Duncan P »

Try changing the order of the N statement and the S statement.
lotsaram
MVP
Posts: 3702
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: RULES: Copying ALL measures from cube to aother

Post by lotsaram »

Try
['Actual' ] =
N: DB(Cube1, dime1 , !Dim_Measure);
S: DB(Cube1, dime1 , !Dim_Measure);

You don't the IF test for DType of measure or the Continue as the N: and S: filters are already doing this for you.
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: RULES: Copying ALL measures from cube to aother

Post by Duncan P »

I no longer have 9.5 installed but my recollection was that you could only have N then C (in that order) in the same statement. If you needed an S it had to be in a different statement and it would only work properly if the S statement was first.

This was not documented. It was just what seemed to work.
mnasra
Posts: 136
Joined: Tue Aug 10, 2010 5:40 pm
OLAP Product: Planning Analytics
Version: 2.0
Excel Version: EXCEL 2013

Re: RULES: Copying ALL measures from cube to aother

Post by mnasra »

Thanks to all of you-

to rmackenzie: Yes dime1 is in both cubes

to Duncan P: changing the order of the N statement or the S Statement- Made either one work (which ever was first)

To Lotsaram: I liked your idea- I thought this is the one- But NO, Like Duncan P said, N and S in the same statement does not work (obviously N and C worked)-

I did 'sort of ' resolve my problem- Here is what I wrote:

['Actual', {num_measure1, Num_measure2'} ] = N: DB(Cube1, dime1 , !Dim_Measure);
['Actual', {String_measure1, string_measure2'} ] = S: DB(Cube1, dime1 , !Dim_Measure);

I obviously dont like it because I have to be always checking if no new measures have been added to that dimension.

Any new idea is MORE than welcome if you happen to think of something else.
Thanks
Thanks
Micheline
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: RULES: Copying ALL measures from cube to aother

Post by Duncan P »

Have you tried

Code: Select all

['Actual' ] = S: DB(Cube1, dime1 , !Dim_Measure);
['Actual' ] = N: DB(Cube1, dime1 , !Dim_Measure);
This should work as you need. The ['Actual'] = S: and the ['Actual'] = N: don't appear to interfere with each other as they are working on different datatypes.
mnasra
Posts: 136
Joined: Tue Aug 10, 2010 5:40 pm
OLAP Product: Planning Analytics
Version: 2.0
Excel Version: EXCEL 2013

Re: RULES: Copying ALL measures from cube to aother

Post by mnasra »

Ducan,
Yes, I did try that one too- NO, it does not work- It applies to which ever is first.
Thanks.
Thanks
Micheline
User avatar
qml
MVP
Posts: 1096
Joined: Mon Feb 01, 2010 1:01 pm
OLAP Product: TM1 / Planning Analytics
Version: 2.0.9 and all previous
Excel Version: 2007 - 2016
Location: London, UK, Europe

Re: RULES: Copying ALL measures from cube to aother

Post by qml »

Do you have AllowSeparateNandCRules=T in your tm1s.cfg? I'm not really sure if it also works for splitting S and N rules (documentation mentions no such thing), but it is needed if you want to split N and C rules for the same area. Might be worth a try.
Kamil Arendt
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: RULES: Copying ALL measures from cube to aother

Post by Duncan P »

I am running version 9.5.2 and with the following rule
rule.png
rule.png (17.66 KiB) Viewed 8005 times
I get this behaviour
cubeview.png
cubeview.png (21.93 KiB) Viewed 8005 times
Is this the kind of behaviour you are after?

EDIT BTW I made the three parts of the rule different to be able to distinguish the behaviour in the view.
mnasra
Posts: 136
Joined: Tue Aug 10, 2010 5:40 pm
OLAP Product: Planning Analytics
Version: 2.0
Excel Version: EXCEL 2013

Re: RULES: Copying ALL measures from cube to aother

Post by mnasra »

SOLVED - THANKS to all-

Yes it was the AllowSeparateNandCrules that I did not have- Thanks QML- (and by the way, it is documented)- see below
And Duncan, Yes, this is the behaviour I wanted, but I could not get it- (because I missed the config)

Also, the S statement HAS TO BE FIRST-

This parameter also effects how numeric and string rules are applied to cells. Without this parameter, the first rule statement that is encountered for a given AREA definition is applied to the cells within the scope of that definition. If any cell within the AREA definition is numeric and the rule is a string rule, then the cell is considered not rule-derived because there was a match that did not apply to the cell.
For example, consider the statements:
['1 Quarter']=s:'str_value';Not following.
['1 Quarter']=n:77;
If the AllowSeparateNandCRules parameter is not set (or is set to F), then the first rule statement will match any cell that uses ‘1 Quarter’ as one of its elements. If the cell is a string cell, the value of the cell will be set to “str_value”. If the cell is a numeric cell, the cell will not be considered rule derived, since a match was found (the first rule) but the rule itself did not apply.
If the AllowSeparateNandCRules parameter is set to T, then string cells which use ‘1 Quarter’ will be set to “str_value” and numeric cells which use ‘1 Quarter’ will be set to 77.To set the parameter to T, add the following line to Tm1s.cfg:
AllowSeparateNandCRules=T
Thanks
Micheline
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: RULES: Copying ALL measures from cube to aother

Post by Duncan P »

The config parameter affects the ability to have separate N and C statements. It does not affect the S statements or their relationship to the others. In the example I showed I have that parameter set to F. It works because the N and C expressions are on the same statement.

The S needing to be first was the reason I suggested initially that you swap the rules round. I should have explained the reason more clearly. I apologise.
mnasra
Posts: 136
Joined: Tue Aug 10, 2010 5:40 pm
OLAP Product: Planning Analytics
Version: 2.0
Excel Version: EXCEL 2013

Re: RULES: Copying ALL measures from cube to aother

Post by mnasra »

Thanks Duncan,

No problem- For some 'weird' reasons, it did not work before I set the config and now it is working.
My only hope is that it behaves the same always. :!:
Thanks
Micheline
Post Reply