<?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>article Howto: URL encoding in QlikView and Qlik Sense in Member Articles</title>
    <link>https://community.qlik.com/t5/Member-Articles/Howto-URL-encoding-in-QlikView-and-Qlik-Sense/ta-p/1496533</link>
    <description>&lt;P&gt;There is currently no built-in support for URL encoding in QV or Sense, but it's actually very easy to achieve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;After years of running into issues getting data from various online services (using &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;... calls), with queries failing or being hard to get right due to incorrectly encoded URL parameters, I realised it's as simple as using the MapSubstring function together with a mapping table created from suitable online HTML tutorial, wikipedia etc - there are lots of sources for the character to URL encoding mapping.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Duh! Better late than never though...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code is very simple:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;// Create mapping table for conversion from utf8 to URL encoded&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;URL_EncodingMap:&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;Mapping LOAD&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace([Character], 'space', ' ') as ASCII_Character,&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Text([From Windows-1252]) as URL_encoding,&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text([From UTF-8]) as URL_encoding&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;FROM&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3schools.com/tags/ref_urlencode.asp" rel="nofollow" target="_blank"&gt;http://www.w3schools.com/tags/ref_urlencode.asp&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;(html, utf8, embedded labels, table is @1)&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;let vMessage = 'Test string including special characters such as #/|\ÅÄÖ';&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;trace $(vMessage);&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;let vMessageNew = MapSubstring('URL_EncodingMap', '$(vMessage)');&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;trace $(vMessageNew);&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will give you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1" style="padding-left: 30px;"&gt;&lt;SPAN class="s1"&gt;Test string including special characters such as #/|\ÅÄÖ&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2" style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1" style="padding-left: 30px;"&gt;&lt;SPAN class="s1"&gt;%54%65%73%74%20%73%74%72%69%6E%67%20%69%6E%63%6C%75%64%69%6E%67%20%73%70%65%63%69%61%6C%20%63%68%61%72%61%63%74%65%72%73%20%73%75%63%68%20%61%73%20%23%2F%7C%5C%C3%85%C3%84%C3%96&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The MapSubstring call can thus be used to get correctly formatted URL parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code above relies on having an Internet connection when executed, this can be a potential failure reason if your Internet connection for some reason goes down. Better then to save the retrieved table to QVD once, then creating the mapping table from that QVD in all other load scripts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Full writeup &lt;A href="https://ptarmiganlabs.com/blog/2016/01/27/url-encoding-in-qlik-sense-and-qlikview/" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;GitHub repo &lt;A href="https://github.com/mountaindude/QlikSense-URL-encode" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jun 2022 11:42:41 GMT</pubDate>
    <dc:creator>mountaindude</dc:creator>
    <dc:date>2022-06-13T11:42:41Z</dc:date>
    <item>
      <title>Howto: URL encoding in QlikView and Qlik Sense</title>
      <link>https://community.qlik.com/t5/Member-Articles/Howto-URL-encoding-in-QlikView-and-Qlik-Sense/ta-p/1496533</link>
      <description>&lt;P&gt;There is currently no built-in support for URL encoding in QV or Sense, but it's actually very easy to achieve.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;After years of running into issues getting data from various online services (using &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;... calls), with queries failing or being hard to get right due to incorrectly encoded URL parameters, I realised it's as simple as using the MapSubstring function together with a mapping table created from suitable online HTML tutorial, wikipedia etc - there are lots of sources for the character to URL encoding mapping.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Duh! Better late than never though...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code is very simple:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;// Create mapping table for conversion from utf8 to URL encoded&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;URL_EncodingMap:&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;Mapping LOAD&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Replace([Character], 'space', ' ') as ASCII_Character,&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Text([From Windows-1252]) as URL_encoding,&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text([From UTF-8]) as URL_encoding&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;FROM&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3schools.com/tags/ref_urlencode.asp" rel="nofollow" target="_blank"&gt;http://www.w3schools.com/tags/ref_urlencode.asp&lt;/A&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;(html, utf8, embedded labels, table is @1)&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;let vMessage = 'Test string including special characters such as #/|\ÅÄÖ';&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;trace $(vMessage);&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;let vMessageNew = MapSubstring('URL_EncodingMap', '$(vMessage)');&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;trace $(vMessageNew);&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will give you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1" style="padding-left: 30px;"&gt;&lt;SPAN class="s1"&gt;Test string including special characters such as #/|\ÅÄÖ&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p2" style="padding-left: 30px;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1" style="padding-left: 30px;"&gt;&lt;SPAN class="s1"&gt;%54%65%73%74%20%73%74%72%69%6E%67%20%69%6E%63%6C%75%64%69%6E%67%20%73%70%65%63%69%61%6C%20%63%68%61%72%61%63%74%65%72%73%20%73%75%63%68%20%61%73%20%23%2F%7C%5C%C3%85%C3%84%C3%96&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The MapSubstring call can thus be used to get correctly formatted URL parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code above relies on having an Internet connection when executed, this can be a potential failure reason if your Internet connection for some reason goes down. Better then to save the retrieved table to QVD once, then creating the mapping table from that QVD in all other load scripts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Full writeup &lt;A href="https://ptarmiganlabs.com/blog/2016/01/27/url-encoding-in-qlik-sense-and-qlikview/" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;GitHub repo &lt;A href="https://github.com/mountaindude/QlikSense-URL-encode" target="_blank"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2022 11:42:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Member-Articles/Howto-URL-encoding-in-QlikView-and-Qlik-Sense/ta-p/1496533</guid>
      <dc:creator>mountaindude</dc:creator>
      <dc:date>2022-06-13T11:42:41Z</dc:date>
    </item>
  </channel>
</rss>

