Page 1 of 1

Concatenation in Rules

Posted: Mon Jun 27, 2011 10:38 am
by anoops81
Hi All ,

I wanted to know whether it is possible to concatenate string elements in rules statement.

I wanted to implement a measure element which evaluates to

Code: Select all

['Low Index']=['Material']|STR([' Index']);
Here Low Index , Material are string elements and Index is numeric .

I encountered an error "Syntax error on or before STR(['Index']); Missing semicolon

Any other suggestions to implement this will be helpful .

Regards
Anoop

Re: Concatenation in Rules

Posted: Mon Jun 27, 2011 10:54 am
by Steve Rowe
Hi, when referencing strings in rules you need to use the full DB( ....) expression.
You also need the S qualifier
Also I'm not sure that you don't have all the arguments of the STR function in place, it's actually like this STR(number, length, decimal)

['Low Index']= S: DB ('cube' , etc, 'Material') | trim( STR([' Index'], 10 ,0)));

Should give you something like you are after.

Cheers

Re: Concatenation in Rules

Posted: Mon Jun 27, 2011 12:25 pm
by anoops81
Hi Steve ,

Thanks So much . It is working fine .