IF I AM NOT attrs

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

IF I AM NOT attrs

Post by Mithun.Mistry1103 »

Hello
I am again on a 3 way road :)

I am writing a rule that says ' If i am not matching the string(in this attrs) in DM1 dimension , make me elements in (DIM1, DIM2, DIM3, DIM4) ALL Grey? How would I solve that? Its a simple question but the methods I have tried just dont work yet they work for other cubes for some reason!

Thank you
Wim Gielis
MVP
Posts: 3229
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: IF I AM NOT attrs

Post by Wim Gielis »

Is your string attribute an alias?
Did you check the values in the cube }ElementAttributes_DIM1 ?
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
mithun.mistry11
Posts: 10
Joined: Sun Sep 07, 2014 9:18 pm
OLAP Product: tm1
Version: 10.2
Excel Version: 2010

Re: IF I AM NOT attrs

Post by mithun.mistry11 »

Hello Wim, its not an alias, it is text and I have looked in the elementattribute and it is correct in that cube...
Wim Gielis
MVP
Posts: 3229
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.1.5
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: IF I AM NOT attrs

Post by Wim Gielis »

Then, as clearly requested in the guidelines for posting here, provide the rule(s) that you have.
Be as clear as possible. Provide additional explanations and screenshots as to the cubes/dimensions/elements/attributes and so on.
Best regards,

Wim Gielis

IBM Champion 2024-2025
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
Michel Zijlema
Site Admin
Posts: 712
Joined: Wed May 14, 2008 5:22 am
OLAP Product: TM1, PALO
Version: both 2.5 and higher
Excel Version: 2003-2007-2010
Location: Netherlands
Contact:

Re: IF I AM NOT attrs

Post by Michel Zijlema »

Mithun.Mistry1103 wrote:Hello
I am again on a 3 way road :)

I am writing a rule that says ' If i am not matching the string(in this attrs) in DM1 dimension , make me elements in (DIM1, DIM2, DIM3, DIM4) ALL Grey? How would I solve that? Its a simple question but the methods I have tried just dont work yet they work for other cubes for some reason!

Thank you
It won't be easy to answer your question without any further information. Could you elaborate on the methods you've tried?

Michel

(edit: posted before I saw Wim's comment)
mithun.mistry11
Posts: 10
Joined: Sun Sep 07, 2014 9:18 pm
OLAP Product: tm1
Version: 10.2
Excel Version: 2010

Re: IF I AM NOT attrs

Post by mithun.mistry11 »

Hello

After reading some of the feedbacks, I came up with an idea to show what I am trying to do. Obviously, because of confidentality, I have designed something on football.
The image below will show that I have players and I have monthly ratings on how those players did those months.
Now because 'sept' has matched this month: September, they will be white cells so I can rate these players again, but as you can see, the other months are grey cells.
That is what I want to achieve... Now if this month: was an attribute, how would I do this using that attribute.

Originally I was trying to do if I am not this month: then grey me out.

Does this make more sense now? :)
Attachments
eXAMPLE.jpg
eXAMPLE.jpg (64.78 KiB) Viewed 6556 times
Neil Watson
Posts: 32
Joined: Wed May 28, 2008 11:41 am
OLAP Product: TM1
Version: 6 and 2.5 to 10.2.2
Excel Version: 2007 2010
Location: Northern England
Contact:

Re: IF I AM NOT attrs

Post by Neil Watson »

Hi,

there are a number of ways to approach this, but first we need to identify exactly what you mean by Grey it out.
I'm going suggest that you want to allow input when the Month = This Month and not when it isn't.

Possible 1
Create another cube which will hold the Ratings data and is fully open to input.
In your cube below, have a rule similar to

['Rating'] = N:
if (!Month @= attrs('Month', !Month, 'This Month'),
stet,
DB('Ratings Source', !Month, !Year, 'Rating')
);


Possible 2
Create a new element in the Measures dimension one called "Input" and the other called "Reporting",
"Input"
"Reporting"

['Reporting'] = N:
if (!Month @= attrs('Month', !Month, 'This Month'),
stet,
['Input']
);


Possible 3
You create security rules on the cube and a rule similar to,
[] = S:
if (DB('}ElementSecurity_Month, !Month, !Groups) @= attrs('Month', 'This Month'),
'WRITE',
'READ'
);


In hindsight, I would go for the easiest most simple which is option 2 and stay away from the security rules until you are far more comfortable.
The syntax may not be exact but it's the principal you're looking for I hope

Good luck
Neil
tomok
MVP
Posts: 2836
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: IF I AM NOT attrs

Post by tomok »

Neil Watson wrote:Possible 1
Create another cube which will hold the Ratings data and is fully open to input.
In your cube below, have a rule similar to

['Rating'] = N:
if (!Month @= attrs('Month', !Month, 'This Month'),
stet,
DB('Ratings Source', !Month, !Year, 'Rating')
);

Possible 2
Create a new element in the Measures dimension one called "Input" and the other called "Reporting",
"Input"
"Reporting"

['Reporting'] = N:
if (!Month @= attrs('Month', !Month, 'This Month'),
stet,
['Input']
);

Possible 3
You create security rules on the cube and a rule similar to,
[] = S:
if (DB('}ElementSecurity_Month, !Month, !Groups) @= attrs('Month', 'This Month'),
'WRITE',
'READ'
);
While Options 1 and 2 will work, they are less then optimal because it will be impossible to have a cube view that looks like what the OP has shown. You would have to do it in a web sheet. Option 3 is the best way to go and it's really quite simple.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Post Reply