<?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: Replace strings in script - not working with Fields?! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Replace-strings-in-script-not-working-with-Fields/m-p/365263#M135926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd use a SubStringMap() function along with the MAPPING LOAD you are already using, so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13431407986905976" jivemacro_uid="_13431407986905976"&gt;&lt;P&gt;NumericCodesMap:&lt;/P&gt;&lt;P&gt;MAPPING LOAD Code, Num INLINE [&lt;/P&gt;&lt;P&gt;Code, Num&lt;/P&gt;&lt;P&gt;CASH_CARRY, 1&lt;/P&gt;&lt;P&gt;HORECA, 2&lt;/P&gt;&lt;P&gt;KIOSK, 3&lt;/P&gt;&lt;P&gt;OTHER, 4&lt;/P&gt;&lt;P&gt;TRADITION, 5&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD MapSubString('NumericCodesMap', 'CASH_CARRY|HORECA|KIOSK|OTHER|TRADITION') AS Edit&lt;/P&gt;&lt;P&gt;AUTOGENERATE 1;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Jul 2012 14:39:48 GMT</pubDate>
    <dc:creator>Miguel_Angel_Baeyens</dc:creator>
    <dc:date>2012-07-24T14:39:48Z</dc:date>
    <item>
      <title>Replace strings in script - not working with Fields?!</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-strings-in-script-not-working-with-Fields/m-p/365262#M135925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to replace the words in the following string with numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Totaling = 'CASH_CARRY|HORECA|KIOSK|OTHER|TRADITION'&lt;/P&gt;&lt;P&gt;Code = CASH_CARRY, HORECA, .....&lt;/P&gt;&lt;P&gt;applymap gives the corresponding numbers for the Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I am using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Replace(Totaling,Code,ApplyMap('MAP_Codes', Code)) as ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but without any success.&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 14:23:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-strings-in-script-not-working-with-Fields/m-p/365262#M135925</guid>
      <dc:creator>ivan_will</dc:creator>
      <dc:date>2012-07-24T14:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Replace strings in script - not working with Fields?!</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-strings-in-script-not-working-with-Fields/m-p/365263#M135926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd use a SubStringMap() function along with the MAPPING LOAD you are already using, so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13431407986905976" jivemacro_uid="_13431407986905976"&gt;&lt;P&gt;NumericCodesMap:&lt;/P&gt;&lt;P&gt;MAPPING LOAD Code, Num INLINE [&lt;/P&gt;&lt;P&gt;Code, Num&lt;/P&gt;&lt;P&gt;CASH_CARRY, 1&lt;/P&gt;&lt;P&gt;HORECA, 2&lt;/P&gt;&lt;P&gt;KIOSK, 3&lt;/P&gt;&lt;P&gt;OTHER, 4&lt;/P&gt;&lt;P&gt;TRADITION, 5&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD MapSubString('NumericCodesMap', 'CASH_CARRY|HORECA|KIOSK|OTHER|TRADITION') AS Edit&lt;/P&gt;&lt;P&gt;AUTOGENERATE 1;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 14:39:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-strings-in-script-not-working-with-Fields/m-p/365263#M135926</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-07-24T14:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Replace strings in script - not working with Fields?!</title>
      <link>https://community.qlik.com/t5/QlikView/Replace-strings-in-script-not-working-with-Fields/m-p/365264#M135927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may also try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt; concat(distinct CorrespondingNumbers,'|',index(Totaling,Code)) as TotalingReplacedWithNumbers&lt;BR /&gt;&lt;BR /&gt;RESIDENT YourTable GROUP BY 1;&lt;BR /&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jul 2012 15:01:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Replace-strings-in-script-not-working-with-Fields/m-p/365264#M135927</guid>
      <dc:creator />
      <dc:date>2012-07-24T15:01:51Z</dc:date>
    </item>
  </channel>
</rss>

