Skip to Content

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

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 10 at 07:34 AM

    Hi Trish,

    Create a formula with this code:

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

    -Abhilash

    Add comment
    10|10000 characters needed characters exceeded

    • Modify the formula to:

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

      -Abhilash

  • Apr 11 at 07:31 AM

    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

    Add comment
    10|10000 characters needed characters exceeded