String Concatenation issue

Post Reply
LoganNSE
Posts: 22
Joined: Fri Nov 18, 2011 10:19 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003 2007

String Concatenation issue

Post by LoganNSE »

Hi,

We need to concatenate validation strings i.e. validation error messages from different parts of the rule/conditions and we are facing an issue in string concatenation (using pipe - |) wherein only 254 bytes are allowed. Looks like our validation error exceeds this limit and they were not displayed.

If(cond.1) then valid_err = Err.1
If(cond.2) then valid_err = valid_err | Err.2
if(cond.3) then valid_err = valid_err | Err.4
...if(cond.n) then valid_err = valid_err | Err.n

Is there any way we can concatenate strings more than the allowed limit 254 bytes?

Thanks & Regards,
Logan
rmackenzie
MVP
Posts: 733
Joined: Wed May 14, 2008 11:06 pm

Re: String Concatenation issue

Post by rmackenzie »

Long strings have been around for a few versions now, so you might be looking at a bug which you need to report to IBM. Please could you post the actual code you are working with that demonstrates the problem. It is not clear from your pseudo-code whether the issue is in rules or TI or something else!
Robin Mackenzie
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: String Concatenation issue

Post by Alan Kirk »

rmackenzie wrote:Long strings have been around for a few versions now, so you might be looking at a bug which you need to report to IBM. Please could you post the actual code you are working with that demonstrates the problem. It is not clear from your pseudo-code whether the issue is in rules or TI or something else!
Yes, that was my first thought but then I noticed that the OP was referring to "different parts of the rule/conditions" (emphasis added). Rules are one of the places where the 254 byte limit still applies; page 34 of the 9.5.2 Rules Guide (the OP's version according to their profile), which is what I think they were referring to:
Concatenating Strings
You can concatenate strings using the pipe | character.

For example, the following expressions returns Rheingold.
(Rhein | gold)

If the string resulting from a concatenation is longer than 254 bytes, TM1® displays an error message.
It's still odd that nothing was shown rather than an error as the manual claims, but as we know... the manuals don't always reflect reality.

Not sure that I'd want a rule that generated such a long error message given the limitations in displaying it, but that's a whole other conversation.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
LoganNSE
Posts: 22
Joined: Fri Nov 18, 2011 10:19 am
OLAP Product: TM1
Version: 9.5.2
Excel Version: 2003 2007

Re: String Concatenation issue

Post by LoganNSE »

Sorry for not being specific - issue is in the RULES.

Sample code - check for data validation (business requirement) and concatenate custom error messages to 'Valid_Err'
['SaleType', 'AView', 'Year', 'Valid_Err'] =S: IF(DB(..) @= '', (DB(...,'Valid_Err') | '; Item does not exist in the A_Master'), CONTINUE);
['SaleType', 'AView', 'Year', 'Valid_Err'] =S: IF(DB(..) @<> DB(..), (DB(...,'Valid_Err') | '; Code changed, please enter comments'), CONTINUE);
['SaleType', 'AView', 'Year', 'Valid_Err'] =S: IF(DB(..) @= DB(..), (DB(...,'Valid_Err') | '; Duplicate entry, please enter a valid method '), CONTINUE);
...['SaleType', 'AView', 'Year', 'Valid_Err'] =S: IF((DB(..) @<> DB(..)) & (DB(..) @<> DB(..)), (DB(...,'Valid_Err') | '; Invalid group entry, please enter adjustment groups with price method'), STET);

Validation error exceeds 70 chars approx/message and as a result of this, I get "ERR" value for 'Valid_Err'.

Thanks for your time.

Thanks & Regards,
Logan
Post Reply