String as Result of Conditional Statements

Post Reply
appleglaze28
Regular Participant
Posts: 269
Joined: Tue Apr 21, 2009 3:43 am
OLAP Product: Cognos TM1, Planning
Version: 9.1 SP3 9.4 MR1 FP1 9.5
Excel Version: 2003

String as Result of Conditional Statements

Post by appleglaze28 »

I'd like to ask if it possible to use String as output of a conditional statement for a String element?

Cause I tried writing for example:

['Message']= IF (['% Increase']<> 0 & ['Increase in Value']<>0, 'Just Enter 1 value','Okay');

Any editting I do, I can't seem to get it right.
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: String as Result of Conditional Statements

Post by kpk »

Try it with "S:"
['Message']=S: IF (['% Increase']<> 0 & ['Increase in Value']<>0, 'Just Enter 1 value','Okay');
Regards,
Peter
Best Regards,
Peter
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: String as Result of Conditional Statements

Post by paulsimon »

Hi

The S: is part of the solution. The other limitation with String Rules is that you cannot use the [ ] notation on the right hand side. You need to use the DB( ) notation, even though you are referencing the same cube.

Regards


Paul Simon
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: String as Result of Conditional Statements

Post by paulsimon »

Hi

Sorry - I didn't notice that the elements that you are referencing are numerics so you should be OK with the [ ].

Regards


Paul Simon
appleglaze28
Regular Participant
Posts: 269
Joined: Tue Apr 21, 2009 3:43 am
OLAP Product: Cognos TM1, Planning
Version: 9.1 SP3 9.4 MR1 FP1 9.5
Excel Version: 2003

Re: String as Result of Conditional Statements

Post by appleglaze28 »

I tried it but I'm getting the error Syntax error on r before 'Just Enter 1 value','Okay'); incorrect logical function
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: String as Result of Conditional Statements

Post by kpk »

appleglaze28 wrote:I tried it but I'm getting the error Syntax error on r before 'Just Enter 1 value','Okay'); incorrect logical function
3 ideas to check:
1. Are you sure that the ['Message'] element is a part of your last dimension in the cube?
2. Are you sure that the ['Message'] element is defined as "S" type?
3. Try to use more parenthesis to make it work
['Message']=S: IF (((['% Increase']<> 0) & (['Increase in Value']<>0)), 'Just Enter 1 value','Okay');
Best Regards,
Peter
kpk
MVP
Posts: 214
Joined: Tue Nov 11, 2008 11:57 pm
OLAP Product: TM1, CX
Version: TM1 7x 8x 9x 10x CX 9.5 10.1
Excel Version: XP 2003 2007 2010
Location: Hungary

Re: String as Result of Conditional Statements

Post by kpk »

You can also try
['Message']=S: IF (['% Increase']*['Increase in Value']<>0, 'Just Enter 1 value','Okay');
Best Regards,
Peter
Post Reply