Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Product Name - Text Extraction 1

Status
Not open for further replies.

paulosinuk

IS-IT--Management
Feb 8, 2001
105
AU
Hi,

I have a product name field that consists of a unique code to identify rooms and meeting rooms within sites. I need to interpret this code to count the number of each tpye of room.

For example 1102L2/EN & BelgiumM12/EN

1102 & Belgium are unique room names
L indicates long term room
M indicates meeting room
2 7 12 represent the seating capacity of the room
/EN indicates the location within the building

I haved been trying to write an analysis routine that trims right until it hits the "/" and then checks the next characters until it hits either an "L" or an "M" and then increments a count for either "Long Term Room" or "Meeting Room"

Any help would be appreciated.
 
ok...so you want to count the type of room it is then try this...

@initialized (suppressed in report header )
numbervar LongTermCount := 0;
numberVar MeetingCount := 0;

@calcRoomCount (suppressed in the detail section probably)

numbervar LongTermCount ;
numberVar MeetingCount ;
numberVar icount;
numberVar iposition:= 1;
stringVar temp := {Table.productName};

while instr(iposition,temp,&quot;/&quot;) <> 0 do
(
iposition := instr(iposition,temp,&quot;/&quot;);
for icount := iposition to 1 step -1 do
(
if temp[icount] = &quot;M&quot; or temp[icount] = &quot;L&quot; then
(
if temp[icount] = &quot;M&quot; then
MeetingCount := MeetingCount + 1;
if temp[icount] = &quot;L&quot; then
LongTermCount := LongTermCount + 1;
iposition := iposition + 1;
exit for;
);
);
);

that should catch all of them...you will have to makeup a formula to display the results,...if you place @initialization in a group header then you must be careful about repeat group headers causing problems so you would
make the formula&quot;

@initialized (suppressed in report header )
if not inrepeatedgroupheader then
numbervar LongTermCount := 0;
if not inrepeatedgroupheader then
numberVar MeetingCount := 0;

Hope this works for you

Jim
JimBroadbent@Hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top