Former Member

Formula - word extraction

I have a formula that extracts the numbr after the x and is used in a calculation. Now the word "fix is being entered before the x5 and it is messing up the formula. Can someone tell me how I can extract the word fix or fixed from this string so my formula below works again.

STRING

fix - x5/zpwv/q2/r57/c89/zons/q1/r104/zbp/q2/r43/u10

Formula

IF Len({@Convert Labor Ticket to Lower Case}) -

Len(Replace({@Convert Labor Ticket to Lower Case},"x","")) >= 1

THEN SPLIT({@Convert Labor Ticket to Lower Case},"/") [1]

10|10000 characters needed characters exceeded

Related questions

Former Member
Posted on Apr 18, 2011 at 07:28 PM

Hi,

I think the main issue is to pickup the value after 'x' to calculate :

can you try the below formula to pickup the value :

Mid((trim(mid({@formula},instr({@formula}, 'fix')3))), (instr((trim(mid({@formula},instr({@formula}, 'fix')3))),'x')+1),1)

Thanks,

Sastry

Note : @formula is nothing but your databse field.

10|10000 characters needed characters exceeded
• Former Member

A couple of changes and this worked well. Thanks.

Working Formula:

if instr({@Convert Labor Tickt to Lower Case},'fixed')= 1

then (trim(mid({@Convert Labor Tickt to Lower Case},instr({@Convert Labor Tickt to Lower Case}, 'fixed')+5)))

else if

instr({@Convert Labor Tickt to Lower Case},'fix') = 1

then (trim(mid({@Convert Labor Tickt to Lower Case},instr({@Convert Labor Tickt to Lower Case}, 'fix')+3)))

else

{@Convert Labor Tickt to Lower Case}