<?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: Applymap issue? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817658#M1213141</link>
    <description>&lt;P&gt;But, if nothing is matched in the mapping table, it should return the same value as output, right? In this case, mapping load doesn’t have 09, so it should return 09 in the result as second applymap is not having else part.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 14:58:47 GMT</pubDate>
    <dc:creator>vamshi_1241</dc:creator>
    <dc:date>2021-06-24T14:58:47Z</dc:date>
    <item>
      <title>Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817646#M1213139</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;Can you help me understand the Applymap results for the field 'Final Code' from below script - (I can use if statement, but thought of trying mapping load here). I was thinking that the Final Code field must return 09 and 91 as output, but the Qlik is done differently here-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CodeMap:&lt;BR /&gt;Mapping Load * Inline&lt;BR /&gt;[&lt;BR /&gt;OldCode, NewCode&lt;BR /&gt;91, 91&lt;BR /&gt;0, 91&lt;BR /&gt;99, 91&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;test:&lt;BR /&gt;Load *,&lt;BR /&gt;// if(left(KeepChar_PhoneNumber, 2) = 91, 91,&lt;BR /&gt;// if(Left(KeepChar_PhoneNumber, 1) = 0, 91,&lt;BR /&gt;// if(Left(KeepChar_PhoneNumber, 2) = 99, 91))) as Code;&lt;/P&gt;&lt;P&gt;Applymap('CodeMap', Left1) as Cod1, //91, 9&lt;BR /&gt;ApplyMap('CodeMap', Left2) as Code2 //09,91&lt;BR /&gt;;&lt;BR /&gt;Load *,&lt;BR /&gt;Len(KeepChar_PhoneNumber) as len_KeepChar_PhoneNumber,&lt;BR /&gt;right(KeepChar_PhoneNumber, 10) as Phone#, // 9912223415&lt;BR /&gt;left(KeepChar_PhoneNumber, 1) as Left1, // 0, 9&lt;BR /&gt;left(KeepChar_PhoneNumber, 2) as Left2 // 09, 91, 99&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;Load PhoneNumber,&lt;BR /&gt;KeepChar(PhoneNumber, '0123456789') as KeepChar_PhoneNumber&lt;BR /&gt;Inline&lt;BR /&gt;[&lt;BR /&gt;PhoneNumber&lt;BR /&gt;+91-99.122.234.15&lt;BR /&gt;991.222.3415&lt;BR /&gt;0 99 122 234 15&lt;BR /&gt;+91-9912223415&lt;BR /&gt;+91/99~122.234.15&lt;BR /&gt;@9912223415&lt;BR /&gt;@0.9912223415&lt;BR /&gt;#0-991.222.3415&lt;BR /&gt;0 99 122 234 15&lt;BR /&gt;+91-9912223415&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;temp:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;load *,&lt;BR /&gt;Applymap('CodeMap', Left1, Applymap('CodeMap', Left2)) as Final_Code&amp;nbsp; &amp;nbsp;//09, 91&lt;BR /&gt;Resident test&lt;BR /&gt;order by Code2 asc;&lt;/P&gt;&lt;P&gt;drop table test;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;exit Script;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:43:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817646#M1213139</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-24T14:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817656#M1213140</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1952"&gt;@vamshi_1241&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think that Final Code doesn't have '09', because your applymap-table (&lt;SPAN&gt;CodeMap) just doesn't have data for '09' condition&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:55:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817656#M1213140</guid>
      <dc:creator>Vladislav_qv_dev</dc:creator>
      <dc:date>2021-06-24T14:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817658#M1213141</link>
      <description>&lt;P&gt;But, if nothing is matched in the mapping table, it should return the same value as output, right? In this case, mapping load doesn’t have 09, so it should return 09 in the result as second applymap is not having else part.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:58:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817658#M1213141</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-24T14:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817664#M1213142</link>
      <description>&lt;P&gt;No, if there are no matches, then ApplyMap returns null-value.&lt;/P&gt;&lt;P&gt;If you want to change that, you should add a 3rd argument to the function, like&lt;/P&gt;&lt;P&gt;ApplyMap('&lt;SPAN&gt;CodeMap',&amp;nbsp;&amp;nbsp;Left1,&amp;nbsp;&amp;nbsp;Left1)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:02:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817664#M1213142</guid>
      <dc:creator>Vladislav_qv_dev</dc:creator>
      <dc:date>2021-06-24T15:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817668#M1213144</link>
      <description>&lt;P&gt;if that is the case - you should see null and 91 instead 09 and 91 with below code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ApplyMap('CodeMap', Left2) as Code2&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:17:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817668#M1213144</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-24T15:17:16Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817672#M1213145</link>
      <description>&lt;P&gt;If I add else part like 'Not matched' in the second applymap - it is giving output as 'Not Matched' and 91 - Which means without else part, it should return 09 as output.&lt;/P&gt;&lt;P&gt;temp:&lt;BR /&gt;NoConcatenate&lt;BR /&gt;load *,&lt;BR /&gt;Applymap('CodeMap', Left1, Applymap('CodeMap', Left2, 'Not Matched')) as Final_Code&amp;nbsp; &amp;nbsp;//09, 91&lt;BR /&gt;Resident test&lt;BR /&gt;order by Code2 asc;&lt;/P&gt;&lt;P&gt;drop table test;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:23:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817672#M1213145</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-24T15:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817678#M1213146</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;&lt;SPAN&gt;Which means without else part, it should return 09 as output.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If there are no matches, it should return null as output&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:40:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817678#M1213146</guid>
      <dc:creator>Vladislav_qv_dev</dc:creator>
      <dc:date>2021-06-24T15:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817686#M1213147</link>
      <description>&lt;P&gt;Have you tested this -&amp;nbsp;&lt;SPAN&gt;ApplyMap('CodeMap', Left2) as Code2&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 16:26:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817686#M1213147</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-24T16:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817690#M1213149</link>
      <description>&lt;P&gt;I think the problem is that you have a mapping for 0 to 91... if you try this... then you should get what you want&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CodeMap:
Mapping
LOAD * INLINE [
    OldCode, NewCode
    91, 91
    99, 91
];
//0, 91

test:
LOAD *,
	 Applymap('CodeMap', Left1) as Cod1, //91, 9
	 ApplyMap('CodeMap', Left2) as Code2; //09,91
LOAD *,
	 Len(KeepChar_PhoneNumber) as len_KeepChar_PhoneNumber,
	 right(KeepChar_PhoneNumber, 10) as Phone#, // 9912223415
	 left(KeepChar_PhoneNumber, 1) as Left1, // 0, 9
	 left(KeepChar_PhoneNumber, 2) as Left2; // 09, 91, 99
LOAD PhoneNumber,
	 KeepChar(PhoneNumber, '0123456789') as KeepChar_PhoneNumber;
LOAD * INLINE [
    PhoneNumber
    +91-99.122.234.15
    991.222.3415
    0 99 122 234 15
    +91-9912223415
    +91/99~122.234.15
    @9912223415
    @0.9912223415
    #0-991.222.3415
    0 99 122 234 15
    +91-9912223415
];

temp:
NoConcatenate
LOAD *,
	 Applymap('CodeMap', Left1, Applymap('CodeMap', Left2)) as Final_Code,   //09, 91
	 Applymap('CodeMap', Left1, Applymap('CodeMap', Left2, 'Not Matched')) as Final_Code_2
Resident test
Order By Code2 asc;

DROP Table test;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 24 Jun 2021 16:48:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817690#M1213149</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-24T16:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817728#M1213151</link>
      <description>&lt;P&gt;I've tested the code one more time.&lt;/P&gt;&lt;P&gt;Sorry, I always thought that if there are no matches, it will return null, but documentation says that the value will be returned as is (&lt;A href="https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/MappingFunctions/ApplyMap.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/MappingFunctions/ApplyMap.htm&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;So now, I don't see any problems. Final code doesn't return '09', because first part of ApplyMap is true: Left1 = 0 and ApplyMap returns '91' as you pointed out in the map table&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 19:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817728#M1213151</guid>
      <dc:creator>Vladislav_qv_dev</dc:creator>
      <dc:date>2021-06-24T19:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817758#M1213154</link>
      <description>&lt;P&gt;Hi Sunny, Thanks for your response. But why is it showing different when 0 to 91 in the mapping load?&lt;/P&gt;&lt;P&gt;That's my requirement - wherever I get the country code 0, I have to replace that with 91.&lt;/P&gt;&lt;P&gt;First Applymap is passing values 0 and 9 (Left1 field) to mapping table, since there is no 9 in load, it will go to the second applymap and&amp;nbsp;here Left2 field passing values 09, 91 and 99. I am not doing any mapping for 09 but still it returns 91 as output instead 09 and 91.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 02:25:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817758#M1213154</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-25T02:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817759#M1213155</link>
      <description>&lt;P&gt;Left1 has two values 0, 9 -&lt;/P&gt;&lt;P&gt;The first part of applymap is true : Left =0 and returns 91.&lt;/P&gt;&lt;P&gt;The first part of applymap is also false: Left1 = 9, there is no mapping for 9 in the load. So, it go to second part of applymap where we are passing Left2 (it has three values - 09,91 and 99). Here, &amp;nbsp;no mapping for 09, so it should give us 09 as output.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 04:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817759#M1213155</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-25T04:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817774#M1213157</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1952"&gt;@vamshi_1241&lt;/a&gt;, Left2 has only 2 values ('99', '91'). If Left2 contains '09', Left1 contains '0', so the first part of ApplyMap will be applied&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Vladislav_qv_dev_0-1624599717704.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57505i87BC5B031F74FDEC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Vladislav_qv_dev_0-1624599717704.png" alt="Vladislav_qv_dev_0-1624599717704.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 05:44:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817774#M1213157</guid>
      <dc:creator>Vladislav_qv_dev</dc:creator>
      <dc:date>2021-06-25T05:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817825#M1213165</link>
      <description>&lt;P&gt;Ok. If you can add the else part in second applymap like ‘not matched’, and see what you get here? You get Not Matched and 91.. how Not Matched will show up here if you have only 99 and 91 values in left2?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 09:28:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817825#M1213165</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-25T09:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817932#M1213181</link>
      <description>&lt;P&gt;I am confused.... I agree that we don't have a mapping for 9, but we do have it for 0 (if we don't remove the highlighted line). Do you agree?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sunny_talwar_0-1624626904084.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57556iEF11E27E383F378D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sunny_talwar_0-1624626904084.png" alt="sunny_talwar_0-1624626904084.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, if we have 0 for Left1... it will be mapped to 91 (first three rows in the below screenshot, agreed?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sunny_talwar_1-1624626986903.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/57557i0F0BE8EAFC545D36/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sunny_talwar_1-1624626986903.png" alt="sunny_talwar_1-1624626986903.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But 9 doesn't meet the condition.... so then we look at Left2... Left 2 for when Left1 is 9... we have 99 OR 91... and both get mapped to 91... so we get 91 for them too?, do you agree?&lt;/P&gt;&lt;P&gt;What am I missing here? Which rows are not showing correctly?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 13:39:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817932#M1213181</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-25T13:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817939#M1213182</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/144397"&gt;@Vladislav_qv_dev&lt;/a&gt;&amp;nbsp;. I am all set now.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 14:02:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817939#M1213182</guid>
      <dc:creator>vamshi_1241</dc:creator>
      <dc:date>2021-06-25T14:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Applymap issue?</title>
      <link>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817941#M1213183</link>
      <description>&lt;P&gt;All set how? What was the issue? How did you fix it?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 14:33:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Applymap-issue/m-p/1817941#M1213183</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2021-06-25T14:33:24Z</dc:date>
    </item>
  </channel>
</rss>

