Skip to Content
0

How to display a field in SAP crystal if it contains a word like

Apr 10 at 12:02 AM

38

avatar image

Hi Team

I have a report that displays the below image:

But I am trying to figure out the correct formula that if the ItemDescription contains the words Black Feet, then the report will just display "romano chair" without the words "Feet"

My formula is..

if WorkOrder.ConfigProptext} like "*Romano Feet*" then ???????

Im not sure how to do it in cystal :(

romano.jpg (65.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Abhilash Kumar
Apr 10 at 07:34 AM
0

Hi Trish,

Create a formula with this code:

If {WorkOrder.ConfigProptext} like "*Black Feet*" then "Romano Chair"
Else {WorkOrder.ConfigProptext}

-Abhilash

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thanks, what if there are 3 options for Romano. These may be Romano Chair, Romano 3-seater and Romano 2-seater.

How can I do the formula.

Basically if the description has the word "Feet" then remove it from the report and retain the first 2 words.

Ex. Romano 2-Seater with Black Feet.

Since it has the word "Black Feet"

then remove the words Black Feet

and it will just display Romano 2-Seater?

0

Modify the formula to:

If {WorkOrder.ConfigProptext} like "*Black Feet*" then (split({WorkOrder.ConfigProptext}, " ")[1] & " " & split({WorkOrder.ConfigProptext}, " ")[2]) 
Else s;

-Abhilash

0
Ian Waterman Apr 11 at 07:31 AM
0

you could use Replace()

If only specific to Romana

If{WorkOrder.ConfigProptext}like"*Romana*" then

Replace({WorkOrder.ConfigProptext}, 'Black Feet', '')

Else{WorkOrder.ConfigProptext}

If all black feet should be removed then

Rplace({WorkOrder.ConfigProptext}, 'Black Feet', '')

Ian

Share
10 |10000 characters needed characters left characters exceeded