cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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 😞

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

abhilash_kumar
Active Contributor
0 Kudos

Hi Trish,

Create a formula with this code:

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

-Abhilash

Former Member
0 Kudos

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?

abhilash_kumar
Active Contributor
0 Kudos

Modify the formula to:

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

-Abhilash