<?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: SQL map error code not working in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771035#M666736</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get failed to open document on your attachment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe you defined the map table after the applymap?&lt;/P&gt;&lt;P&gt;or the name of the mapping table and the name used in ApplyMap are different?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Nov 2014 23:37:05 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2014-11-18T23:37:05Z</dc:date>
    <item>
      <title>SQL map error code not working</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771033#M666734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a SQL script below working fine :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pick(Match(kode_reject, 5, 39), 'reject human error', 'reject machine error') AS DESC_REJECT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Due to too many error code , i decide to change to mapping :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ApplyMap('SegmentMap', subfield(kode_reject,' ',1), 'Other') AS DESC_REJECT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SegmentMap:&lt;/P&gt;&lt;P&gt;MAPPING LOAD * INLINE [&lt;/P&gt;&lt;P&gt;Original, New&lt;/P&gt;&lt;P&gt;5,Human error&lt;/P&gt;&lt;P&gt;39,Machine error&lt;/P&gt;&lt;P&gt;A2,Business Partner&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i reload script , it does not show any error code , but the DESC_REJECT field all value display null or missing value "-"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any advise where go wrong on below line :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ApplyMap('SegmentMap', subfield(kode_reject,' ',1), 'Other') AS DESC_REJECT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 15:46:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771033#M666734</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2014-11-18T15:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: SQL map error code not working</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771034#M666735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any one can help on this ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:19:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771034#M666735</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2014-11-18T23:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: SQL map error code not working</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771035#M666736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get failed to open document on your attachment&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe you defined the map table after the applymap?&lt;/P&gt;&lt;P&gt;or the name of the mapping table and the name used in ApplyMap are different?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:37:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771035#M666736</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-11-18T23:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: SQL map error code not working</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771036#M666737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I'm checking your app from the other thread &lt;A href="https://community.qlik.com/thread/142669"&gt;why SegmentMap: table not generated in SQL mode ?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I noticed that you're creating the mapping table at the end of the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mapping tables should be already defined before using the ApplyMap function.&lt;/P&gt;&lt;P&gt;For that you have to promote the "error code" script tab before the "raw data" tab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:39:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771036#M666737</guid>
      <dc:creator />
      <dc:date>2014-11-18T23:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: SQL map error code not working</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771037#M666738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From Qlik online help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The &lt;SPAN class="Bold"&gt;ApplyMap&lt;/SPAN&gt; function is used for mapping any expression to a previously loaded mapping table&lt;/STRONG&gt;. The syntax is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor833"&gt;&lt;/A&gt;&lt;A name="applymap"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;applymap(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;'mapname', expr [ , defaultexpr ] &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;where:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;mapname&lt;/SPAN&gt; is the name of a mapping table that has previously been created through the &lt;SPAN class="Bold"&gt;mapping load&lt;/SPAN&gt; or the &lt;SPAN class="Bold"&gt;mapping select&lt;/SPAN&gt; statement (see &lt;A class="MCXref_0"&gt;&lt;EM&gt;Mapping&lt;/EM&gt;&lt;/A&gt;). Its name must be enclosed by single, straight &lt;A class="MCXref_0"&gt;&lt;EM&gt;Quotation Marks in Scripting&lt;/EM&gt;&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;expr&lt;/SPAN&gt; is the expression, the result of which should be mapped.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;defaultexpr&lt;/SPAN&gt; is an optional expression which will be used as a default mapping value if the mapping table does not contain a matching value for &lt;SPAN class="Italic"&gt;expr&lt;/SPAN&gt;. If no default value is given, the value of &lt;SPAN class="Italic"&gt;expr&lt;/SPAN&gt; will be returned as is.&lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P class="Code"&gt;// Assume the following mapping table:&lt;/P&gt;&lt;P class="Code"&gt;map1:&lt;/P&gt;&lt;P class="Code"&gt;mapping load * inline [&lt;/P&gt;&lt;P class="Code"&gt;x, y&lt;/P&gt;&lt;P class="Code"&gt;1, one&lt;/P&gt;&lt;P class="Code"&gt;2, two&lt;/P&gt;&lt;P class="Code"&gt;3, three ] ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;ApplyMap ('map1', 2 )&lt;/SPAN&gt; returns ' two'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;ApplyMap ('map1', 4 )&lt;/SPAN&gt; returns 4&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;ApplyMap ('map1', 5, 'xxx')&lt;/SPAN&gt; returns 'xxx'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;ApplyMap ('map1', 1, 'xxx')&lt;/SPAN&gt; returns 'one'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;ApplyMap ('map1', 5, null( ) )&lt;/SPAN&gt; returns NULL&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;ApplyMap ('map1', 3, null( ) )&lt;/SPAN&gt; returns 'three'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;MapSubstring&lt;/SPAN&gt; function is used to map parts of any expression to a previously loaded mapping table. The mapping is case sensitive and non-iterative and substrings are mapped from left to right. The syntax is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;A name="kanchor834"&gt;&lt;/A&gt;&lt;A name="mapsubstring"&gt;&lt;/A&gt;&lt;SPAN class="Bold"&gt;mapsubstring(&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt;'mapname', expr&lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This function can be used for mapping parts of any expression on a previously loaded mapping table. The mapping is case sensitive and non-recursive. The substrings are mapped from the left to the right. &lt;SPAN class="Italic"&gt;Mapname&lt;/SPAN&gt; is the name of a mapping table previously read by a &lt;SPAN class="Bold"&gt;mapping load&lt;/SPAN&gt; or a &lt;SPAN class="Bold"&gt;mapping select&lt;/SPAN&gt; statement (see &lt;A class="MCXref_0"&gt;&lt;EM&gt;Mapping&lt;/EM&gt;&lt;/A&gt;). The name must be enclosed by single straight quotation marks. &lt;SPAN class="Italic"&gt;Expr&lt;/SPAN&gt; is the expression whose result should be mapped by substrings.&lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P class="Code"&gt;// Assume the following mapping table:&lt;/P&gt;&lt;P class="Code"&gt;map1:&lt;/P&gt;&lt;P class="Code"&gt;mapping load * inline [&lt;/P&gt;&lt;P class="Code"&gt;x, y&lt;/P&gt;&lt;P class="Code"&gt;1, &amp;lt;one&amp;gt;&lt;/P&gt;&lt;P class="Code"&gt;aa, XYZ&lt;/P&gt;&lt;P class="Code"&gt;x, b ] ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;MapSubstring ('map1', 'A123')&lt;/SPAN&gt; returns 'A&amp;lt;one&amp;gt;23'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;MapSubstring ('map1', 'baaar')&lt;/SPAN&gt; returns 'bXYZar'&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;MapSubstring ('map1', 'xaa1')&lt;/SPAN&gt; returns 'bXYZ&amp;lt;one&amp;gt;'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Nov 2014 23:44:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771037#M666738</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-11-18T23:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL map error code not working</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771038#M666739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi jp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes you are right and have spotted also i cannot place the mapping table before load the raw data , any solution ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 00:00:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771038#M666739</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2014-11-19T00:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL map error code not working</title>
      <link>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771039#M666740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for the documentation , in fact i have use this mapping command for my project before , but this is the first time i try read raw data from SQL , and i am not sure why SQL not allow create mapping table before load raw data from SQL , as i place the mapping table before loading SQL data i get error , any way to avoid it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Nov 2014 00:08:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/SQL-map-error-code-not-working/m-p/771039#M666740</guid>
      <dc:creator>paulyeo11</dc:creator>
      <dc:date>2014-11-19T00:08:12Z</dc:date>
    </item>
  </channel>
</rss>

