<?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: Modify field value in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328902#M1181630</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John Is it possible to also use this with Wildcards?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Mar 2017 10:59:46 GMT</pubDate>
    <dc:creator>ngrunoz</dc:creator>
    <dc:date>2017-03-20T10:59:46Z</dc:date>
    <item>
      <title>Modify field value in script</title>
      <link>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328898#M1181626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a field I am pulling in that is sometimes prefaced with "SMX", like "SMX0012345"&amp;nbsp; Often times it is just "0012345"&lt;/P&gt;&lt;P&gt;What I would like to do in the script is IF LEFT 3 LIKE 'SMX', REPLACE 'SMX' with '77'&lt;/P&gt;&lt;P&gt;So SMX0012345 becomes 770012345, while 0012345 remains 0012345.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;JL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 22:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328898#M1181626</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-29T22:53:27Z</dc:date>
    </item>
    <item>
      <title>Modify field value in script</title>
      <link>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328899#M1181627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Replace(YOURFIELD,'SMX','77') as YOURFIELD&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;from YOURTABLE;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 23:02:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328899#M1181627</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-29T23:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Modify field value in script</title>
      <link>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328900#M1181628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And if you have more than a few such replacements, I like to handle it with a mapping table rather than nesting replaces:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Text Substitutions]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MAPPING LOAD * INLINE [&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;From, To&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;SMX, 77&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;ABC, XYZ&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Hello, Goodbye&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,mapsubstring('Text Substitutions',YOURFIELD) as YOURFIELD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;from YOURTABLE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Neither of our solutions is specifically checking that it's the left three bytes, though.&amp;nbsp; If that's important:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,if(left(YOURFIELD,3)='SMX','77'&amp;amp;mid(YOURFIELD,4),YOURFIELD) as YOURFIELD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;from YOURTABLE;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 23:12:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328900#M1181628</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-12-29T23:12:19Z</dc:date>
    </item>
    <item>
      <title>Modify field value in script</title>
      <link>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328901#M1181629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; BINGO Mr. Witherspoon, spot on on your second suggestion.&amp;nbsp; (Yes, specific to left 3.)&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 00:01:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328901#M1181629</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-12-30T00:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Modify field value in script</title>
      <link>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328902#M1181630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John Is it possible to also use this with Wildcards?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 10:59:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328902#M1181630</guid>
      <dc:creator>ngrunoz</dc:creator>
      <dc:date>2017-03-20T10:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Modify field value in script</title>
      <link>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328903#M1181631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not mapsubstring(), but you could do a pick(1+wildmatch(field,wild1,wild2,wild3),field,new1,new2,new3). A way to set something like this up with a table, just like you might use with mapsubstring, is given by &lt;A href="https://community.qlik.com/qlik-users/2286"&gt;rwunderlich&lt;/A&gt; in his QlikView cookbook:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;A href="http://qlikviewcookbook.com/download/mapping-with-wildcards/"&gt;http://qlikviewcookbook.com/download/mapping-with-wildcards/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like there's a version of this in QlikView Components as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;A href="https://github.com/RobWunderlich/Qlikview-Components"&gt;https://github.com/RobWunderlich/Qlikview-Components&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 16:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Modify-field-value-in-script/m-p/328903#M1181631</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2017-03-20T16:06:36Z</dc:date>
    </item>
  </channel>
</rss>

