Hello Sir,I am confused about dimix.The reference guide says if( dimix(dimensionname,elementname)=1) means in TI if element exists and the rules guide says in chap10 ---> IF(DIMIX(’Date’, !Date)=1) means This rules say "if the current date is the first date in the Date dimension, thenQuantity in Stock - Kgs is 0; otherwise Quantity in Stock - Kgs is equal toyesterday's Remaining value from the Depletion cube for the immediatelyprevious DaysOld batch.Is there different usage for dimix in rules and TI and what is the difference.thanks for clarifying my doubt.The complete rules example----> [’Quantity in Stock - Kgs’]= N: IF(DIMIX(’Date’, !Date)=1,
0, DB(’Depletion’,!FishType,DIMNM(’Date’, DIMIX(’Date’, !Date)-1),
DIMNM(’DaysOld’,DIMIX(’DaysOld’, !DaysOld) -1),’Remaining’));
dimix use
- Martin Ryan
- Site Admin
- Posts: 1988
- Joined: Sat May 10, 2008 9:08 am
- OLAP Product: TM1
- Version: 10.1
- Excel Version: 2010
- Location: Wellington, New Zealand
- Contact:
Re: dimix use
I can see two possible angles to your question so hopefully one of the two answers is what you're after.
DIMIX of zero means that an element is not in the dimension. E.g. dimix('DaysOfTheWeek', 'Tomato'); is likely to return zero because 'Tomato' isn't an element in the DaysOfTheWeek dimension. So the typical use of this is or
However from the second half of your question I think you're talking about finding out what the next element in the dimension is.
Likewise this returns the previous element in the dimension.
Personally I'm not a fan of this approach because it means two function calls, and if your dimension in not in the order you think it is, then you'll get unpredictable numbers. I prefer setting up "Next" and "Prev" attributes, then using them like so
DIMIX of zero means that an element is not in the dimension. E.g. dimix('DaysOfTheWeek', 'Tomato'); is likely to return zero because 'Tomato' isn't an element in the DaysOfTheWeek dimension. So the typical use of this is
Code: Select all
if(dimix('MyDim', Elem)<>0); do something; endif;
Code: Select all
if(dimix('MyDim', Elem)=0); do something else; endif;
Code: Select all
['Tomorrows']=dbrw('Cube', dimnm('Day', dimix('Day', !Day)+1), !FishType);
Code: Select all
['Yesterdays']=dbrw('Cube', dimnm('Day', dimix('Day', !Day)-1), !FishType);
Code: Select all
['Tomorrows']=dbrw('Cube', attrs('Day', !Day, 'Next'), !FishType);
['Yesterdays']=dbrw('Cube', attrs('Day', !Day, 'Prev'), !FishType);
Please do not send technical questions via private message or email. Post them in the forum where you'll probably get a faster reply, and everyone can benefit from the answers.
Jodi Ryan Family Lawyer
Jodi Ryan Family Lawyer
-
- Posts: 43
- Joined: Fri Aug 01, 2014 5:17 pm
- OLAP Product: Cognos
- Version: 10.1.1
- Excel Version: 2010
Re: dimix use
Thank you.if(dimix('MyDim', Elem)=0) returns 0 or 1 depending on element exists in the dimension.in the rule it says---->IF(DIMIX(’Date’, !Date)=1) means This rules say "if the current date is the first date in the Date dimension,here value of 1 is assigned if the current date is the first date in the Date dimension.this usage confusing me.once again,thanks for clarifying my doubt.
-
- MVP
- Posts: 1815
- 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: dimix use
Dimix is not a boolean yes/no function as to whether an element exists or not; a 0 response does indeed indicate the the element specified does not exist in the dimension - but if the element does exist it will return the index of the element within the dimension (i.e. 1 if the element is the first in the dimension or 999999 if it is the 999999th element in the dimension.)Moh wrote:Thank you.if(dimix('MyDim', Elem)=0) returns 0 or 1 depending on element exists in the dimension.in the rule it says---->IF(DIMIX(’Date’, !Date)=1) means This rules say "if the current date is the first date in the Date dimension,here value of 1 is assigned if the current date is the first date in the Date dimension.this usage confusing me.once again,thanks for clarifying my doubt.
Declan Rodger
-
- Posts: 43
- Joined: Fri Aug 01, 2014 5:17 pm
- OLAP Product: Cognos
- Version: 10.1.1
- Excel Version: 2010
Re: dimix use
thank you all.