<?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: Multiple MapSubstring in a single function call in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160605#M13219</link>
    <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just removed the Verbatim statament and it worked as expected, lol&lt;/P&gt;
&lt;P&gt;Why??? I don't understand. If Qlik's default approach is to remove extra spaces, it should work only with Verbatim = 1, shouldnt it?&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jan 2024 14:28:35 GMT</pubDate>
    <dc:creator>pedrohenriqueperna</dc:creator>
    <dc:date>2024-01-11T14:28:35Z</dc:date>
    <item>
      <title>Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160228#M13205</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a mapping table with many values that I replace for nothing. A string can contain multiple values that should be replaced and what I'm doing works if I nest/repeat the function.&lt;/P&gt;
&lt;P&gt;This works: MapSubstring('ReplaceMap', MapSubstring('ReplaceMap', myField))&lt;/P&gt;
&lt;P&gt;I nested it because I thought the function would replace only 1 value within the string, but it happens that if I use a single function &amp;lt; MapSubtring('ReplaceMap', myField) &amp;gt; it replaces multiple values, but not all of them&lt;/P&gt;
&lt;P&gt;For instance:&lt;/P&gt;
&lt;P&gt;MapTable:&lt;/P&gt;
&lt;P&gt;Mapping LOAD * Inline [&lt;/P&gt;
&lt;P&gt;" AVENIDA ", " "&lt;/P&gt;
&lt;P&gt;" RUA ", " "&lt;/P&gt;
&lt;P&gt;" TRAVESSA ", " "&lt;/P&gt;
&lt;P&gt;" LOTE ", " "&lt;/P&gt;
&lt;P&gt;" ENGENHEIRO ", " "&lt;/P&gt;
&lt;P&gt;" QUADRA ", " "&lt;/P&gt;
&lt;P&gt;" DE ", " "&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I apply the map on a string&amp;nbsp; ' '&amp;amp;"AVENIDA RUA ENGENHEIRO TRAVESSA DE QUADRA LOTE"&amp;amp;' ' it should give me a blank, but the output value turns out to be "RUA TRAVESSA QUADRA".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why is this happening? Shouldn't it replace every substring? What's the criteria? I tried changing the order of the valeus in the table but I get the same result every time. If I use a nested mapsubstring it works perfectly, but at this point I'm trying to reduce processing the most I can&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 19:44:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160228#M13205</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-10T19:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160593#M13214</link>
      <description>&lt;P&gt;For me it worked like expected:&lt;/P&gt;
&lt;P&gt;MapTable:&lt;BR /&gt;Mapping LOAD * Inline [&lt;BR /&gt;&lt;STRONG&gt;Lookup, Return&lt;/STRONG&gt;&lt;BR /&gt;" AVENIDA ", " "&lt;BR /&gt;" RUA ", " "&lt;BR /&gt;" TRAVESSA ", " "&lt;BR /&gt;" LOTE ", " "&lt;BR /&gt;" ENGENHEIRO ", " "&lt;BR /&gt;" QUADRA ", " "&lt;BR /&gt;" DE ", " "&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;load *, mapsubstring('MapTable', F1) as F2;&lt;BR /&gt;load ''&amp;amp; 'AVENIDA RUA ENGENHEIRO TRAVESSA DE QUADRA LOTE ' &amp;amp; '' as F1 autogenerate 1;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marcus_sommer_0-1704982188654.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/126903i9130C3B9AC27F063/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marcus_sommer_0-1704982188654.png" alt="marcus_sommer_0-1704982188654.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160593#M13214</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-01-11T14:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160598#M13216</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;,&amp;nbsp;thanks for the reply! I was just calling out for you help in the other thread I opened, hehe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Everything you suggested got me to progress, but for some reason Mapsubstring is not adding the space as replacement.&lt;/P&gt;
&lt;P&gt;"Or" just replied to this thread (deleted the reply), but he's right. The problem is the absence of a space in front of the following substrings, and that is because Mapsubstring is not adding the space set as replacement.&lt;/P&gt;
&lt;P&gt;I set the Verbatim = 1 as you suggested. Not really sure why this is happening. Shouldn't it respect the space?&lt;/P&gt;
&lt;P&gt;If add ". " as replacement instead, it only adds ".", for e.g&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:20:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160598#M13216</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T14:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160599#M13217</link>
      <description>&lt;P&gt;Did you set the Verbatim = 1 in the testing you made and worked as expected?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:22:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160599#M13217</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T14:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160604#M13218</link>
      <description>&lt;P&gt;I deleted my post because I figured Marcus's reply would be more useful than mine since I wasn't able to actually test the code... but if that helped, great.&lt;/P&gt;
&lt;P&gt;I think the issue might be that the actions are all being done on the original string, and the modified string with the replacements only comes about after all the substrings are replaced. But no idea if that's actually the case, just guessing.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:27:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160604#M13218</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2024-01-11T14:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160605#M13219</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just removed the Verbatim statament and it worked as expected, lol&lt;/P&gt;
&lt;P&gt;Why??? I don't understand. If Qlik's default approach is to remove extra spaces, it should work only with Verbatim = 1, shouldnt it?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:28:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160605#M13219</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T14:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160610#M13220</link>
      <description>&lt;P&gt;It helped indeed. Thanks!&lt;/P&gt;
&lt;P&gt;I'm not sure if it's about changing the original string, actually I don't understand how that would impact the result. It's something related to Qlik's behaviour dealing with spaces. At first, marcus suggestion to use Verbatim = 1 got me through some parts, but since then I changed a lot of stuff to optmize the processing. Some things were redundant, etc.&lt;/P&gt;
&lt;P&gt;It seems to work perfectly now, but I'm very curious to understand the reason.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 14:32:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160610#M13220</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T14:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160631#M13221</link>
      <description>&lt;P&gt;Actually it's not working. I got back to where I first needed to set verbatim = 1&lt;/P&gt;
&lt;P&gt;It's replacing part of strings, e.g " DE " will replace any substring that has "DE" within:&lt;/P&gt;
&lt;P&gt;AVENIDA CASA GRANDE will become &amp;gt; CASA GRAN&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 15:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160631#M13221</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T15:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160643#M13222</link>
      <description>&lt;P&gt;It's even more weird, because the spaces within the "from" value are considered, but the space as "to" value is not respected:&lt;/P&gt;
&lt;P&gt;" RUA " will only look for strings that holds both spaces. After removing " AVENIDA ", it replaces the substring with nothing, so the result will be "RUA ENGENHEIRO TRAVESSA DE QUADRA LOTE". Given the fact that there's no "RUA " in the mapping table, but " RUA ", it doesn't replace the substring. So the problem seems to be only with the space as replacement, not within the value&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 15:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160643#M13222</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T15:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160670#M13223</link>
      <description>&lt;P&gt;I'm just trying everything that comes to my mind, removing, adding spaces, etc, and I noticed it actually adds the space, although the table does not display extra spaces by default.&lt;/P&gt;
&lt;P&gt;If I change " AVENIDA "," " to a double space &amp;gt; " AVENIDA ","&amp;nbsp; ", it does add 2 spaces as shown in the print below. But for some reason it doesn't replace the string. Maybe the ASCII chars are different? It's not like it's removing the spaces as I suspected. It adds, but the word with spaces seems to no be recognized, only those that already have leading and trailing spaces and the first substring that receives an extra space with ' '&amp;amp;Mapsubstring([...])&amp;amp;' '&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="therealdees_0-1704988094498.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/126920i31DCD4C6D3D6E6F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="therealdees_0-1704988094498.png" alt="therealdees_0-1704988094498.png" /&gt;&lt;/span&gt;&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>Thu, 11 Jan 2024 15:48:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160670#M13223</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T15:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160675#M13224</link>
      <description>&lt;P&gt;I'm not sure if there isn't an overlapping between the various replacements and that maybe not all could be fulfilled within a single approach - independently of the space-topic. I just played a bit with/without verbatim and also with leading and/or ending spaces ... like stated I couldn't absolutely comprehend why what happens and would need more time for it.&lt;/P&gt;
&lt;P&gt;I suggest to make at least some attempts by skipping the space-matter - means replacing the spaces with another unique char, maybe just '|' in beforehand. Further to consider if it's possible to replace leading/ending/inbetween spaces differently.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 16:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160675#M13224</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-01-11T16:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160679#M13225</link>
      <description>&lt;P&gt;I really appreciate your effort.&lt;/P&gt;
&lt;P&gt;Indeed the spaces are not really necessary, it's just part of the string that I have to deal with. I'll try to replace every space with "|" and I'll let you know if it worked. If you find out something else I'll be curious to know.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 16:21:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160679#M13225</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T16:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160698#M13226</link>
      <description>&lt;P&gt;I changed the logic to replace spaces with "|" and unfortunately got the same result, but it gave me an insight.&lt;/P&gt;
&lt;P&gt;It seems to me that the removal of the words happens before the replacement is insert. For instance:&lt;/P&gt;
&lt;P&gt;MapTable:&lt;/P&gt;
&lt;P&gt;Mapping LOAD * Inline [&lt;/P&gt;
&lt;P&gt;"|AVENIDA|", "|"&lt;/P&gt;
&lt;P&gt;"|RUA|", "|"&lt;/P&gt;
&lt;P&gt;"|TRAVESSA|", "|"&lt;/P&gt;
&lt;P&gt;"|LOTE|", "|"&lt;/P&gt;
&lt;P&gt;"|ENGENHEIRO|", "|"&lt;/P&gt;
&lt;P&gt;"|QUADRA|", "|"&lt;/P&gt;
&lt;P&gt;"|DE|", "|"&lt;/P&gt;
&lt;P&gt;];&lt;/P&gt;
&lt;P&gt;This will give me the same result, although the output seems to do the right transformation:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="therealdees_0-1704991894085.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/126925iFC38CCE1A51E6AE7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="therealdees_0-1704991894085.png" alt="therealdees_0-1704991894085.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I change to "RUA|","|" then it removes correctly the string:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="therealdees_1-1704991973731.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/126926i015416ABB9BF01C4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="therealdees_1-1704991973731.png" alt="therealdees_1-1704991973731.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems to me that regardless of adding a "|" as replacement, Qlik still sees the value as "RUA|". Maybe it temporary saves in memory with no replacement for then add the replacements after the calculation?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 16:54:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160698#M13226</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T16:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple MapSubstring in a single function call</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160700#M13227</link>
      <description>&lt;P&gt;Thank goodness I made it.&lt;/P&gt;
&lt;P&gt;If I add a double "||" and replace "|RUA|","" it works.&lt;/P&gt;
&lt;P&gt;It will replace the whole chain (|AVENIDA|) but will keep a "|" to match the next substring. I'll investigate further if it worked without exception, but it seems to be working fine!!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2024 17:02:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Multiple-MapSubstring-in-a-single-function-call/m-p/2160700#M13227</guid>
      <dc:creator>pedrohenriqueperna</dc:creator>
      <dc:date>2024-01-11T17:02:46Z</dc:date>
    </item>
  </channel>
</rss>

