<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: SAP Crystal Report - Replace formula syntax in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaa-p/12472787#M4672591</link>
    <description>&lt;P&gt;Hi, I couldn't quite understand the question. &lt;/P&gt;&lt;P&gt;If you were to replace any type of character within a string the syntax of the replace function would be the same in this example.&lt;/P&gt;&lt;P&gt;
Inside the {Command.test} I have a string with the value := "123.abc.456" &lt;/P&gt;&lt;P&gt;If I use -&amp;gt; replace({Command.test},".","") &lt;/P&gt;&lt;P&gt;The result will be the treated string would be "123abc456" without the point it was asked to take. &lt;/P&gt;&lt;P&gt;Now if what you need is to treat an empty or null-valued string, I suggest treating it with a condition first, because as the value is empty you cannot pass an empty value to the function, in the function it will read as if you had not passed it parameter.&lt;/P&gt;&lt;P&gt;
IF ISNULL({Command.test}) OR {Command.test} = "" THEN "NOT_string" &lt;/P&gt;&lt;P&gt;ELSE {Command.test} &lt;/P&gt;&lt;P&gt;Then in this case you would have a value to pass as a parameter of the replace function, which would be the "NOT_string", but this case is very specific, because with the condition you did, what the replace function would do. &lt;/P&gt;&lt;P&gt;REPLACE( &lt;/P&gt;&lt;P&gt;(IF ISNULL({Command.test}) OR {Command.test} = "" THEN "NOT_string"&lt;/P&gt;&lt;P&gt;
ELSE {Command.test}),"NOT_string","_")&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2021 12:06:39 GMT</pubDate>
    <dc:creator>former_member1141152</dc:creator>
    <dc:date>2021-10-01T12:06:39Z</dc:date>
    <item>
      <title>SAP Crystal Report - Replace formula syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaq-p/12472785</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;Please share the syntax for REPLACE function in SAP Crystal Report. We have SQL datafield BOOK NO . it is STRING. I need to FIND character , and REPLACE with EMPTY string&lt;/P&gt;
  &lt;P&gt;REPLACE({CurrentFieldValue},",","") -&amp;gt; throws error &lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 07:13:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaq-p/12472785</guid>
      <dc:creator>former_member1347830</dc:creator>
      <dc:date>2021-10-01T07:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Crystal Report - Replace formula syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaa-p/12472786#M4672590</link>
      <description>&lt;P&gt;Thank you for visiting SAP
Community to get answers to your questions. Since this is your first question, I
recommend that you familiarize yourself with &lt;U&gt;&lt;A href="https://community.sap.com/resources/questions-and-answers"&gt;Community
Q&amp;amp;A&lt;/A&gt;&lt;/U&gt; , as the overview provides tips for
preparing questions that draw responses from our members. &lt;/P&gt;&lt;P&gt;Should you wish, you can revise
your question by selecting Actions, then Edit.&lt;/P&gt;&lt;P&gt;By adding a picture to your Profile
you encourage readers to respond.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 07:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaa-p/12472786#M4672590</guid>
      <dc:creator>former_member763929</dc:creator>
      <dc:date>2021-10-01T07:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Crystal Report - Replace formula syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaa-p/12472787#M4672591</link>
      <description>&lt;P&gt;Hi, I couldn't quite understand the question. &lt;/P&gt;&lt;P&gt;If you were to replace any type of character within a string the syntax of the replace function would be the same in this example.&lt;/P&gt;&lt;P&gt;
Inside the {Command.test} I have a string with the value := "123.abc.456" &lt;/P&gt;&lt;P&gt;If I use -&amp;gt; replace({Command.test},".","") &lt;/P&gt;&lt;P&gt;The result will be the treated string would be "123abc456" without the point it was asked to take. &lt;/P&gt;&lt;P&gt;Now if what you need is to treat an empty or null-valued string, I suggest treating it with a condition first, because as the value is empty you cannot pass an empty value to the function, in the function it will read as if you had not passed it parameter.&lt;/P&gt;&lt;P&gt;
IF ISNULL({Command.test}) OR {Command.test} = "" THEN "NOT_string" &lt;/P&gt;&lt;P&gt;ELSE {Command.test} &lt;/P&gt;&lt;P&gt;Then in this case you would have a value to pass as a parameter of the replace function, which would be the "NOT_string", but this case is very specific, because with the condition you did, what the replace function would do. &lt;/P&gt;&lt;P&gt;REPLACE( &lt;/P&gt;&lt;P&gt;(IF ISNULL({Command.test}) OR {Command.test} = "" THEN "NOT_string"&lt;/P&gt;&lt;P&gt;
ELSE {Command.test}),"NOT_string","_")&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 12:06:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaa-p/12472787#M4672591</guid>
      <dc:creator>former_member1141152</dc:creator>
      <dc:date>2021-10-01T12:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAP Crystal Report - Replace formula syntax</title>
      <link>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaa-p/12472788#M4672592</link>
      <description>&lt;P&gt;Or, easier than going through all of that, in the Formula Editor, change the null handling for this formula to "Default values for nulls" instead of "Exception for nulls".  This will automatically replace a null field value with an empty string.  Replace will work with any string value - even an empty string - but it throws an error on a null.&lt;/P&gt;&lt;P&gt;-Dell &lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 13:39:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sap-crystal-report-replace-formula-syntax/qaa-p/12472788#M4672592</guid>
      <dc:creator>DellSC</dc:creator>
      <dc:date>2021-10-01T13:39:50Z</dc:date>
    </item>
  </channel>
</rss>

