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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trimming an item description 1

Status
Not open for further replies.

AdamRicko

Technical User
Feb 19, 2009
97
GB
I have some item descriptions that have an Alcoholic volume at the end of the description. I need to supress the volume as this is being shown elsewhere on my report. But note, not all descriptions have the volume at the end so simply cutting the last 3 digits wont work. e.g.


CARLING 4.0

But i am already using a formulae for my description because i also had unwanted information at the beggining of my description.

trimleft(mid({FRL_LIVE_Item.Description}, instr({FRL_LIVE_Item.Description}," ")+1))

Any help would be greatly appreciated.

AdamRicko

CR2008
 
Please can you give some more examples including some with and some without the volume showing.

That way we can help provide a solution that will cater for the different scenarios.

Show an example list as you would like to see it before and after.

'J

CR8.5 / CRXI - Discovering the impossible
 
BEFORE

500ml DOUBLE HOP (Re Marstons) (UK) NRB 5.0
275ml MACKESON NRB 3.0
30Ltr VELTINS 4.8
275ml HOLSTEN NRB 5.0
330ml CORONA EXTRA NRB 4.6
FLEURIE PIERRE PONNELLE 2007
BOURGOGNE ALIGOTE RENARD 2006
GIGONDAS CHAPOUTIER 2006
OLD COACH ROAD SAUVIGNON BLANC 2008
BUSHMILLS SINGLE MALT 10 YO
J2O APPLE & MANGO NRB
J2O ORANGE & PASSIONFRUIT NRB
KALIBER NRB .05

AFTER

DOUBLE HOP (Re Marstons) (UK) NRB
MACKESON NRB
VELTINS
HOLSTEN NRB
CORONA EXTRA NRB
FLEURIE PIERRE PONNELLE 2007
BOURGOGNE ALIGOTE RENARD 2006
GIGONDAS CHAPOUTIER 2006
OLD COACH ROAD SAUVIGNON BLANC 2008
BUSHMILLS SINGLE MALT 10 YO
J2O APPLE & MANGO NRB
J2O ORANGE & PASSIONFRUIT NRB
KALIBER NRB

The above are all different products, the formulae in my earlier post was made to get rid of the item size at the beggining of description e.g. 500ml/30ltr/275ml.


Hope this helps,

AR



 
That helps a lot - Try the following:

if instr(extractstring(strreverse({@description}),'',' '),'.') > 0 then
replace({@description},strreverse(extractstring(strreverse({@description}),'',' ')),'') else
{@description}

Yuck...I hate reverse logic lol.

See how you get on with the above - is untested so please advise of any errors.

'J


CR8.5 / CRXI - Discovering the impossible
 
Yep thats working a treat to get rid of my alcohol volumes. allthough i cant get it to work in conjunction with my other formulae.

trimleft(mid({FRL_LIVE_Item.Description}, instr({FRL_LIVE_Item.Description}," ")+1)) and


if instr(extractstring(strreverse({FRL_LIVE_Item.Description}),'',' '),'.') > 0 then
replace({FRL_LIVE_Item.Description},strreverse(extractstring(strreverse({FRL_LIVE_Item.Description}),'',' ')),'') else
{FRL_LIVE_Item.Description}


I am getting a boolean error on the highlighted text. Somethings telling me its to do with the if/then/else statement ?

Thanks in advance for your help, this stuff is way above my knowledge.

AR
 
If your other formula is already in use for display purposes just point the new formula at it for reference.

In the quote above just replace {@Description} with the name of your exisiting formula which contains:

trimleft(mid({FRL_LIVE_Item.Description}, instr({FRL_LIVE_Item.Description}," ")+1))

'J

CR8.5 / CRXI - Discovering the impossible
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top