Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » substring
substring [message #142708] Fri, 10 March 2006 13:30 Go to next message
No real name is currently offline No real nameFriend
Messages: 6
Registered: July 2009
Junior Member
Hi,

In the dataset, i want to make a computed column that contains the first 2
letters from row("ORDER")

In the expression builder i want to use the substr or substring
functionality, but i get a javascript error saying that the function does
not exists.

How can i get the first 2 digits of the string? Where can i find the right
syntax?
Re: substring [message #142723 is a reply to message #142708] Fri, 10 March 2006 13:37 Go to previous messageGo to next message
mr. burns is currently offline mr. burnsFriend
Messages: 402
Registered: July 2009
Senior Member
Hello,

in the expression builder for the computed column try following code:

row["ORDER"].substring(1,3)

if row["ORDER"] equals e.g. ABCD it will return AB

hope that helps!
Re: substring [message #142733 is a reply to message #142708] Fri, 10 March 2006 13:40 Go to previous message
mr. burns is currently offline mr. burnsFriend
Messages: 402
Registered: July 2009
Senior Member
Hello,

sorry ;-) it must be:

row["ORDER"].substring(0,2) // to show the 1st two letters, beacause arrays
start with index zero!

if row["ORDER"] equals e.g. ABCD it will return AB

hope that helps!
Previous Topic:Problems Display
Next Topic:log file
Goto Forum:
  


Current Time: Tue Apr 23 15:13:15 GMT 2024

Powered by FUDForum. Page generated in 0.02846 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top