Page 1 of 1
String as Result of Conditional Statements
Posted: Mon Nov 23, 2009 9:29 am
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.
Re: String as Result of Conditional Statements
Posted: Mon Nov 23, 2009 9:38 am
by kpk
Try it with "S:"
['Message']=S: IF (['% Increase']<> 0 & ['Increase in Value']<>0, 'Just Enter 1 value','Okay');
Regards,
Peter
Re: String as Result of Conditional Statements
Posted: Mon Nov 23, 2009 7:13 pm
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
Re: String as Result of Conditional Statements
Posted: Mon Nov 23, 2009 7:15 pm
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
Re: String as Result of Conditional Statements
Posted: Tue Nov 24, 2009 12:49 am
by appleglaze28
I tried it but I'm getting the error Syntax error on r before 'Just Enter 1 value','Okay'); incorrect logical function
Re: String as Result of Conditional Statements
Posted: Tue Nov 24, 2009 8:26 am
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');
Re: String as Result of Conditional Statements
Posted: Tue Nov 24, 2009 8:29 am
by kpk
You can also try
['Message']=S: IF (['% Increase']*['Increase in Value']<>0, 'Just Enter 1 value','Okay');