If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Crystal Reports > Pull part of a string into a report.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-05-11, 17:36
dbk412 dbk412 is offline
Registered User
 
Join Date: Jul 2011
Posts: 9
Pull part of a string into a report.

I'm new to crystal reports and have recently moved information that I use to maintain in a spreadsheet into an ODBC databse that is connected to CR10. Previously I was able to seperate the info in excel with the "text to columns" button using the 'space' as a delimiter. Is there a formula that I can use to identify the space delimiter? Once I've parsed the string, I would like to build a formula that adds the qty of like drum sizes. Ultimately, I am pulling a report from a shipping table to gather metrics on the number of different size containers being shipped each day. Unfortanately this information is kept in a text string.

the table field I'm pulling from is {lineitem.adddescrip} and the line items look like this:
The profile id is followed by the quantity of containers shipped x container size.

X28342 1x30 2x15 2x55
H50108 1x5 1x30
H50108 1x10 1x20
X99293 10x5 5x55

I want to be able to ignore the first profile id and just pull the container information into a report like this (summing 'like' container sizes):
7x55
2x30
1x20
2x15
11x5

Any help is greatly appreciated.

Last edited by dbk412; 11-05-11 at 20:26.
Reply With Quote
  #2 (permalink)  
Old 11-28-11, 14:59
mission mission is offline
Registered User
 
Join Date: Oct 2010
Posts: 44
You need to do basic string parsing to retrieve the text that you wanted.

From the sample data you provided, it appears that you need to:
  1. Look for the first " "
  2. Substring the part of text from the first " " to the end of text
  3. Repeat for the next " " until the field is completely parsed
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On