Page 1 of 1
Rule issue
Posted: Fri Mar 13, 2015 1:03 pm
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
Re: Rule issue
Posted: Fri Mar 13, 2015 2:15 pm
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.
Re: Rule issue
Posted: Fri Mar 13, 2015 3:34 pm
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.
Re: Rule issue
Posted: Mon Mar 16, 2015 11:45 am
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
Re: Rule issue
Posted: Mon Mar 16, 2015 12:27 pm
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.
Re: Rule issue
Posted: Mon Mar 16, 2015 4:01 pm
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
Re: Rule issue
Posted: Mon Mar 16, 2015 10:17 pm
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
Re: Rule issue
Posted: Mon Mar 23, 2015 10:31 am
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!
Re: Rule issue
Posted: Mon Mar 23, 2015 10:42 am
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' );
Re: Rule issue
Posted: Mon Mar 23, 2015 12:19 pm
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?
Re: Rule issue
Posted: Mon Mar 23, 2015 12:45 pm
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.