<?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 Re: How can I delete specific characters from a string variable? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25561#M787521</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your code looks good&lt;/P&gt;&lt;P&gt;can you use it in load&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;IF(Left(SourceString,3) = 'Mr ',&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Right(SourceString,Len(SourceString)-3), next one, as &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;SourceString&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Feb 2018 19:15:33 GMT</pubDate>
    <dc:creator>zebhashmi</dc:creator>
    <dc:date>2018-02-14T19:15:33Z</dc:date>
    <item>
      <title>How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25553#M787513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have a variable/column called NAME, where some names start with "Dr ", Mr" etc. and I want to delete this to make "Mr. James" become only "James", for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did this subroutine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SUB CleanName (SourceString)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;IF Left(SourceString,3) = 'Mr '&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SourceString = Right(SourceString,Len(SourceString)-3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;IF Left(SourceString,3) = 'Ms '&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SourceString = Right(SourceString,Len(SourceString)-3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;IF Left(SourceString,4) = 'Mrs '&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SourceString = Right(SourceString,Len(SourceString)-4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;IF Left(SourceString,3) = 'Dr '&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;SourceString = Right(SourceString,Len(SourceString)-3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;END SUB&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;And called it by typing&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;CALL CleanName(NAME);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;in the last row of the Main tab, nut it didn't work.&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Any friend can point me where is the error or how can I do what I want?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25553#M787513</guid>
      <dc:creator>mlarruda</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25554#M787514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your load statement for the column NAME, try the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;if(match(subfield(NAME,' ',1),'Mr','Ms','Mrs','Dr'),subfield(NAME,' ',2),NAME) as NAME&lt;/P&gt;&lt;P&gt;from.....&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25554#M787514</guid>
      <dc:creator>stascher</dc:creator>
      <dc:date>2018-02-14T17:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25555#M787515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if(left(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,2)='Ms', replace(&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,'Ms ',''),&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if(left(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,2)='Mr', replace(&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,'Mr ',''),&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if(left(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,2)='Dr', replace(&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,'Dr ',''),&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;if(left(&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,3)='Mrs', replace(&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13.3333px;"&gt;SourceString,'Mrs ','')))))&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:52:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25555#M787515</guid>
      <dc:creator>lcontezini</dc:creator>
      <dc:date>2018-02-14T17:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25556#M787516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot, but how this code will work: Will a name like "Feodr Petrov" be changed to "Feo Petrov" or simply "Petrov"? I &lt;STRONG&gt;DON'T WANT&lt;/STRONG&gt; that such changes happens, because here the "dr" is parte of the name rather than an abbreviation of "Doctor".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:55:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25556#M787516</guid>
      <dc:creator>mlarruda</dc:creator>
      <dc:date>2018-02-14T17:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25557#M787517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Thanks a lot, but this code will not avoid that names like "Feodr Petrov" be changed to "Feo Petrov". I &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;DON'T WANT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt; that such changes happens, because here the "dr" is parte of the name rather than an abbreviation of "Doctor".&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 17:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25557#M787517</guid>
      <dc:creator>mlarruda</dc:creator>
      <dc:date>2018-02-14T17:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25558#M787518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will not alter Feodr Petrov because subfield(1) returns Feodr which does not match any of the strings 'Mr','Mrs','Ms' or 'Dr'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:06:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25558#M787518</guid>
      <dc:creator>stascher</dc:creator>
      <dc:date>2018-02-14T18:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25559#M787519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code will replace &lt;STRONG&gt;only if the initials&lt;/STRONG&gt; of the name are 'Dr', 'Ms'...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the case of &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;"Feodr Petrov", the code left(SourceString,2) will return &lt;STRONG&gt;FALSE&lt;/STRONG&gt; and there will be &lt;STRONG&gt;no&lt;/STRONG&gt; replacing.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:20:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25559#M787519</guid>
      <dc:creator>lcontezini</dc:creator>
      <dc:date>2018-02-14T18:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25560#M787520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But if the string is "Dr Feodr Petrov" your code will replace both "dr", remaining "Feo Petrov"...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25560#M787520</guid>
      <dc:creator>mlarruda</dc:creator>
      <dc:date>2018-02-14T18:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25561#M787521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your code looks good&lt;/P&gt;&lt;P&gt;can you use it in load&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;IF(Left(SourceString,3) = 'Mr ',&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: 'courier new', courier;"&gt;Right(SourceString,Len(SourceString)-3), next one, as &lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier;"&gt;SourceString&lt;/SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:15:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25561#M787521</guid>
      <dc:creator>zebhashmi</dc:creator>
      <dc:date>2018-02-14T19:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25562#M787522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but didn't work. The subfield(NAME,' ',2) is extracting only the 2nd word of the string. E.g. "Mr James Smith" is returning only "James" instead of "James Smith".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:34:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25562#M787522</guid>
      <dc:creator>mlarruda</dc:creator>
      <dc:date>2018-02-14T19:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25563#M787523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks but didn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:54:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25563#M787523</guid>
      <dc:creator>mlarruda</dc:creator>
      <dc:date>2018-02-14T19:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I delete specific characters from a string variable?</title>
      <link>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25564#M787524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Merging some suggestions, I found the solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(match(subfield($1,' ',1),'Mr','Ms','Mrs','Dr'),trim(replace($1,subfield($1,' ',1),' ')),$1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank very much for all!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Feb 2018 19:57:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-can-I-delete-specific-characters-from-a-string-variable/m-p/25564#M787524</guid>
      <dc:creator>mlarruda</dc:creator>
      <dc:date>2018-02-14T19:57:07Z</dc:date>
    </item>
  </channel>
</rss>

