<?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>topic Replace one character in string in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Replace-one-character-in-string/m-p/1995722#M11482</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to write an expression where if the fourth character of a string is '1', it is replaced with a 'P'. I'm able to replace the character and keep the expression before the fourth character, but am having trouble keeping the latter half of the string because if there is another '1' later in the string, the subfield portion of the expression picks those up as well. How to get the rest of the text after a certain character? I'm sure there are better ways to accomplish what I wrote. Any improvements are also greatly appreciated. Thank you!&lt;/P&gt;
&lt;P&gt;This is the expression I used and I'm trying to fill in the blank space. I used the subfield expression below to fill in the space but it is not functioning correctly.&lt;/P&gt;
&lt;P&gt;=if(mid([Animal Name], 4,1) = '1', left([Animal Name], 3)&amp;amp;replace(mid([Animal Name], 4,1), '1', 'P'&amp;amp;_______), [Animal Name])&lt;/P&gt;
&lt;P&gt;=subfield([Animal Name], mid([Animal Name], 4, 1), -1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="297"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;&lt;STRONG&gt;Animal Name&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;&lt;STRONG&gt;Desired Output&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;CHI1ABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;CHIPABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;COWLABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;COWLABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;PIG12351&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;PIGP2351&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;SH11IO1BB&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;SH1PIO1BB&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;A111WBI154&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;A11PWBI154&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
    <pubDate>Fri, 21 Oct 2022 21:00:45 GMT</pubDate>
    <dc:creator>Sara1</dc:creator>
    <dc:date>2022-10-21T21:00:45Z</dc:date>
    <item>
      <title>Replace one character in string</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Replace-one-character-in-string/m-p/1995722#M11482</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd like to write an expression where if the fourth character of a string is '1', it is replaced with a 'P'. I'm able to replace the character and keep the expression before the fourth character, but am having trouble keeping the latter half of the string because if there is another '1' later in the string, the subfield portion of the expression picks those up as well. How to get the rest of the text after a certain character? I'm sure there are better ways to accomplish what I wrote. Any improvements are also greatly appreciated. Thank you!&lt;/P&gt;
&lt;P&gt;This is the expression I used and I'm trying to fill in the blank space. I used the subfield expression below to fill in the space but it is not functioning correctly.&lt;/P&gt;
&lt;P&gt;=if(mid([Animal Name], 4,1) = '1', left([Animal Name], 3)&amp;amp;replace(mid([Animal Name], 4,1), '1', 'P'&amp;amp;_______), [Animal Name])&lt;/P&gt;
&lt;P&gt;=subfield([Animal Name], mid([Animal Name], 4, 1), -1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="297"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;&lt;STRONG&gt;Animal Name&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;&lt;STRONG&gt;Desired Output&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;CHI1ABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;CHIPABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;COWLABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;COWLABFBW&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;PIG12351&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;PIGP2351&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;SH11IO1BB&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;SH1PIO1BB&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="159"&gt;
&lt;P&gt;A111WBI154&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="139"&gt;
&lt;P&gt;A11PWBI154&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 21 Oct 2022 21:00:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Replace-one-character-in-string/m-p/1995722#M11482</guid>
      <dc:creator>Sara1</dc:creator>
      <dc:date>2022-10-21T21:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Replace one character in string</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Replace-one-character-in-string/m-p/1995733#M11483</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I think this should do the trick:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;=if(mid([Animal Name], 4, 1) = '1',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;left([Animal Name], 3) &amp;amp; 'P' &amp;amp; right([Animal Name], len([Animal Name])-4),&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[Animal Name])&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Also replied on other duplicate post:&amp;nbsp;&lt;BR /&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Dev/Replace-part-of-String/td-p/1995723" target="_blank"&gt;https://community.qlik.com/t5/QlikView-App-Dev/Replace-part-of-String/td-p/1995723&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 23:34:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Replace-one-character-in-string/m-p/1995733#M11483</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2022-10-21T23:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Replace one character in string</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Replace-one-character-in-string/m-p/1996320#M11489</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;Nicole, this worked perfectly!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 22:16:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Replace-one-character-in-string/m-p/1996320#M11489</guid>
      <dc:creator>Sara1</dc:creator>
      <dc:date>2022-10-24T22:16:08Z</dc:date>
    </item>
  </channel>
</rss>

