Rule issue

Post Reply
Mithun.Mistry1103
Posts: 63
Joined: Thu Jul 03, 2014 1:14 pm
OLAP Product: cognos
Version: 10.2.2
Excel Version: 2010

Rule issue

Post by Mithun.Mistry1103 »

Hello

I am trying to do something that should be very easy but seems like I am missing something out of the rule


Basically,I have two cubes:

Cube 1: Dimension 1, Dimension 2, Dimension 3 and Dimension 4: Element 3, Element 4
Cube 2: Dimension 5, Dimension 2, Dimension 6: Element 1, Element 7

Now my rule in cube 1 is:

Code: Select all

  ['element 4'] = s: If (DB('Cube 2', !Dimension 5, !Dimension 2, 'Element 1') @= DB('Cube 1', !Dimension1, !Dimension 2,  !Dimension 3, 'Element 3'), DB('Cube 2', !Dimension 5, !Dimension 2, 'Element 7'), 'N'); 
What I am trying to do is if element 1 and element 3 match then feed in into element 4 what is in Element 7

Is that correct or am I doing something wrong, missing anything. Because I am getting grey cells with no data. I appreciate I do not have the same amount of dimensions on both cubes but I have also considered that and it still doesnt make a difference


Thank you for the advise in advance!

Regards
Mithun
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Rule issue

Post by jim wood »

Well for a starter for 10 you've made the question very difficult to understand by numbering the dimensions randomly. I think I understand what you're asking (think) and I can only guess that having cubes with a different number of dimensions is tripping you up. Or are struggling with how to create a variable feeder? Either way you need to make you question clearer.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Gabor
MVP
Posts: 170
Joined: Fri Dec 10, 2010 4:07 pm
OLAP Product: TM1
Version: [2.x ...] 11.x / PAL 2.1.13
Excel Version: Excel 2016-2021-365
Location: Germany

Re: Rule issue

Post by Gabor »

I see that you reference "!Dimension 5" in the rule of cube 1, but this dim exists in cube 2 only. This will not work.
Mithun.Mistry1103
Posts: 63
Joined: Thu Jul 03, 2014 1:14 pm
OLAP Product: cognos
Version: 10.2.2
Excel Version: 2010

Re: Rule issue

Post by Mithun.Mistry1103 »

Hello @Jim

Hopefully this will make more sense

So if Team (Element in a dimension) in cube 1 matches Team (element in a dimension) in cube 2 matches then

get the data in Current Pos (element) and stick it in Position in cube 1


Hope that helps

The yellow highlighs are dimensions

@Gabor

Thanks for your interest, I did that as a test, to see if it accepted an unkwn dimension

Thank you
Attachments
scenerio.jpg
scenerio.jpg (64.83 KiB) Viewed 7902 times
User avatar
jim wood
Site Admin
Posts: 3961
Joined: Wed May 14, 2008 1:51 pm
OLAP Product: TM1
Version: PA 2.0.7
Excel Version: Office 365
Location: 37 East 18th Street New York
Contact:

Re: Rule issue

Post by jim wood »

You don't need an if statement. If you simply put ['Position'] = N: DB(Cube.....!Team...); the rule will only pull data where the elements in the 2 team dimensions line up,

Jim.
Struggling through the quagmire of life to reach the other side of who knows where.
Go Build a PC
Jimbo PC Builds on YouTube
OS: Mac OS 11 PA Version: 2.0.7
Mithun.Mistry1103
Posts: 63
Joined: Thu Jul 03, 2014 1:14 pm
OLAP Product: cognos
Version: 10.2.2
Excel Version: 2010

Re: Rule issue

Post by Mithun.Mistry1103 »

Hello Jim

Im quite confused now. I have just done that and that doesnt work either which is understandable as you cannot map two cubes on one time dimension. Although one quiestion, my rule earlier, was that missing anything because it was what i did for another cube and that worked.. Yes the difference was that it was a 'y' and 'n' statement, not using data?!


Thanks for your help buddy, :) do appreciate all your time and effort

Regards
Mithun
User avatar
paulsimon
MVP
Posts: 808
Joined: Sat Sep 03, 2011 11:10 pm
OLAP Product: TM1
Version: PA 2.0.5
Excel Version: 2016
Contact:

Re: Rule issue

Post by paulsimon »

Hi Mithun

Please refer to what Gabor said. You cannot use !Dimension 5 in a rule on Cube 1, if Cube 1 does not have Dimension 5.

You refer to getting the value of Element 1, but you are actually getting the value of the cell identified by something called 'Element 1' in some dimension in combination with elements in the other dimensions.

As Jim said it would be a lot clearer if you posted the actual rule that you are writing with the real dimension and element names. I doubt that you will be giving anything away. We all work on cubes that calculate profit and have cost centres, unless you are working for the security service and Element 1 is really the name of 007.

Regards

Paul Simon
Mithun.Mistry1103
Posts: 63
Joined: Thu Jul 03, 2014 1:14 pm
OLAP Product: cognos
Version: 10.2.2
Excel Version: 2010

Re: Rule issue

Post by Mithun.Mistry1103 »

Hello Paul

Nope, not 007 thats for sure :)

Ok, the following image is what I have at the moment

Thank you

P.S. The rule works for individual elements so I know I am close!
Attachments
Transact.jpg
Transact.jpg (130.39 KiB) Viewed 7378 times
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: Rule issue

Post by declanr »

Something along the lines of:

Code: Select all

['PassportID']=S:
	DB ( 'Personal', !MWeek, 
			DB ( 'Account', !MWeek, !MNINumber, !MAccount_ID, !MTransact, 'MAccountID' ),
	                'Passport ID' );
Declan Rodger
Mithun.Mistry1103
Posts: 63
Joined: Thu Jul 03, 2014 1:14 pm
OLAP Product: cognos
Version: 10.2.2
Excel Version: 2010

Re: Rule issue

Post by Mithun.Mistry1103 »

Hey declanr

Thats worked for me, thank you....what I changed is shown below:

['PassportID']=S:
Db('Personal', DB ( 'Account', !MWeek, !MNINumber, !MTransact, 'MaccountID'), !Mweek, 'Passport ID');

Because of the dimensional order. It makes sense why we would do it this way that you mentioned as its much easier but what could I have done in terms of the @= or will that just not work for what I am trying to achieve? As i Mentioned, it worked to a certain point then then collapsed.

Apologies if this is getting longwinded but Its just a learning what and why you would do it one way and not the other?
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: Rule issue

Post by declanr »

Mithun.Mistry1103 wrote:Hey declanr

Thats worked for me, thank you....what I changed is shown below:

['PassportID']=S:
Db('Personal', DB ( 'Account', !MWeek, !MNINumber, !MTransact, 'MaccountID'), !Mweek, 'Passport ID');

Because of the dimensional order. It makes sense why we would do it this way that you mentioned as its much easier but what could I have done in terms of the @= or will that just not work for what I am trying to achieve? As i Mentioned, it worked to a certain point then then collapsed.

Apologies if this is getting longwinded but Its just a learning what and why you would do it one way and not the other?
Yes sorry, I had a couple of typos as it was still a bit tricky to follow when presented in that format.

I can't say exactly as I assume the rule you've posted isn't the actual one considering it doesn't use the correct syntax and it refers to "PasswordID" which I think should be "PassportID"?
But:

Code: Select all

['PasswordID'] = s:IF('Personal', !Mweek,!Maccount_ID,'MAID') @= ('Account', !Mweek, !MNINumber, !Mtransact, 'MaccountID'), ('Personal',!Mwek,!Maccount_ID,'Passport ID'), 'N');
If corrected syntactically would never work since you are using "!Maccount_ID" which doesn't exist in the "Account" cube so it won't ever be able to find anything for it (and therefore the rule wouldn't save.)
As such you need to get the !Maccount_ID via a DB into the "Account" cube at which point the logical comparison would ALWAYS be true and therefore redundant e.g.

Code: Select all

DB('Personal', !Mweek, DB ('Account', !Mweek, !MNINumber, !Mtransact, 'MaccountID'), 'MAID')
would always equal

Code: Select all

DB ('Account', !Mweek, !MNINumber, !Mtransact, 'MaccountID')
I am assuming that the measure "MAID" is just a lookup to the dimension !Maccount_ID from the screenshots and that has resulted in the statements above.
But on that subject I am intrigued as to why you would bring the dimension element name into the cube as a cell value; since you are then going to create many duplicates of data that probably aren't needed - since you can just look at the dimension element.
Declan Rodger
Post Reply