<?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: IP address to country &amp;amp; City mapping in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2521244#M106528</link>
    <description>&lt;P&gt;Is there any solution for this?&lt;BR /&gt;I am still unable to find solution to convert IPv6 to number in qlik&lt;/P&gt;</description>
    <pubDate>Mon, 16 Jun 2025 08:20:11 GMT</pubDate>
    <dc:creator>poojashribanger</dc:creator>
    <dc:date>2025-06-16T08:20:11Z</dc:date>
    <item>
      <title>IP address to country &amp; City mapping</title>
      <link>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2516012#M105739</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P class=""&gt;I have a table that contains IP addresses and currencies, but I need to determine the country.&lt;/P&gt;&lt;P class=""&gt;Is it possible to map the country using the IP address and currency?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="poojashribanger_0-1745845279707.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/179999iFFBB5637C7E72396/image-size/medium?v=v2&amp;amp;px=400" role="button" title="poojashribanger_0-1745845279707.png" alt="poojashribanger_0-1745845279707.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Any Help will be appreciated!&lt;/P&gt;&lt;P&gt;Thanks in Advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;!--  
        Layout, Style or Voice Helpers
      --&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;!--  
        Compliance
      --&gt;&lt;DIV class=""&gt;&lt;!--   For autoSmartRem addNewWindowWarnings div is referenced in an aria-describedby   --&gt;&lt;DIV&gt;Opens in new window&lt;/DIV&gt;&lt;DIV&gt;PDF Download&lt;/DIV&gt;&lt;DIV&gt;Word Download&lt;/DIV&gt;&lt;DIV&gt;Excel Download&lt;/DIV&gt;&lt;DIV&gt;PowerPoint Download&lt;/DIV&gt;&lt;DIV&gt;Document Download&lt;/DIV&gt;&lt;/DIV&gt;&lt;!--  
        Versioning Control Panel if versioning = true !
      --&gt;&lt;!--  
        Launcher
      --&gt;&lt;!--   Toolbar   --&gt;&lt;!--  
        Site Menu
      --&gt;&lt;!--  
        Generic Aria Live message container
      --&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;!--   Symbol definitions   --&gt;&lt;/DIV&gt;&lt;!--   end #ae_app   --&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 13:03:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2516012#M105739</guid>
      <dc:creator>poojashribanger</dc:creator>
      <dc:date>2025-04-28T13:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: IP address to country &amp; City mapping</title>
      <link>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2516013#M105740</link>
      <description>&lt;P&gt;If you Google it up, you'll find plenty of options for getting locations from an IP address. Pick one you like and use that.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Apr 2025 13:31:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2516013#M105740</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2025-04-28T13:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: IP address to country &amp; City mapping</title>
      <link>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2516487#M105802</link>
      <description>&lt;P&gt;For IPv4 it's working fine but for IPv6 i am unable to convert to number.&lt;/P&gt;&lt;P&gt;If someone can help me in converting this ipv6 code to number in qlik.&lt;/P&gt;&lt;P&gt;Please see below.&lt;BR /&gt;Mapping File range :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="poojashribanger_0-1746188446898.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/180153iC5E92E014919B793/image-size/medium?v=v2&amp;amp;px=400" role="button" title="poojashribanger_0-1746188446898.png" alt="poojashribanger_0-1746188446898.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;My data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="poojashribanger_1-1746188888330.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/180154i199F306660B1FCC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="poojashribanger_1-1746188888330.png" alt="poojashribanger_1-1746188888330.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in Advance&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2025 12:29:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2516487#M105802</guid>
      <dc:creator>poojashribanger</dc:creator>
      <dc:date>2025-05-02T12:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: IP address to country &amp; City mapping</title>
      <link>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2521244#M106528</link>
      <description>&lt;P&gt;Is there any solution for this?&lt;BR /&gt;I am still unable to find solution to convert IPv6 to number in qlik&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 08:20:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2521244#M106528</guid>
      <dc:creator>poojashribanger</dc:creator>
      <dc:date>2025-06-16T08:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: IP address to country &amp; City mapping</title>
      <link>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2521264#M106530</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/33037"&gt;@poojashribanger&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you can convert numbers from hex to decimal by using following command:&lt;/P&gt;&lt;P&gt;num(num#(NewIPAddress, '(hex)'))&lt;/P&gt;&lt;P&gt;I'm not sure how the ranges from your Mapping Range were created but you'll need to transform each 4 digits. Since you seem to always have the first 4 blocks of the IP, I would suggest something like so:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; num(num#(SubField(NewIPAddress, ':',1), '(hex)')*pow(16, 12))
+num(num#(SubField(NewIPAddress, ':',1), '(hex)')*pow(16,  8))
+num(num#(SubField(NewIPAddress, ':',2), '(hex)')*pow(16,  4))
+num(num#(SubField(NewIPAddress, ':',3), '(hex)')*pow(16,  0))
    as NewIPAddress&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 10:31:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2521264#M106530</guid>
      <dc:creator>lennart_mo</dc:creator>
      <dc:date>2025-06-16T10:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: IP address to country &amp; City mapping</title>
      <link>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2521271#M106532</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/300891"&gt;@lennart_mo&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks a lot for suggesting the solution!&lt;/P&gt;&lt;P&gt;I've implemented the IPv6-to-numeric conversion in SQL as below. While Qlik doesn’t support the full precision of the numeric result (it displays the value in exponential format), when I cast it as text, the output appears correctly.&lt;/P&gt;&lt;P&gt;Here’s the core of my SQL logic:&lt;/P&gt;&lt;P&gt;select *,&lt;BR /&gt;cast(IPNumtest as char) as test&lt;BR /&gt;from ( SELECT *,&lt;BR /&gt;CASE&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;WHEN ip_type = 'IPv4' THEN INET_ATON(NewIPAddress)&lt;BR /&gt;ELSE&lt;BR /&gt;CAST(&lt;BR /&gt;CONV(SUBSTRING(HEX(INET6_ATON(FullIPv6)), 1, 16), 16, 10) AS DECIMAL(39, 0)&lt;BR /&gt;) * POW(2, 64) +&lt;BR /&gt;CAST(&lt;BR /&gt;CONV(SUBSTRING(HEX(INET6_ATON(FullIPv6)), 17, 16), 16, 10) AS DECIMAL(39, 0)&lt;BR /&gt;)&lt;BR /&gt;END AS IpNumeric,&lt;BR /&gt;(CAST(CONV(SUBSTR(HEX(INET6_ATON(FullIPv6)), 1, 16), 16, 10) AS DECIMAL(39,0))&lt;BR /&gt;* 18446744073709551616)&lt;BR /&gt;+ CAST(CONV(SUBSTR(HEX(INET6_ATON(FullIPv6)), 17, 16), 16, 10) AS DECIMAL(39,0)) as IPNumtest&lt;BR /&gt;FROM (&lt;BR /&gt;SELECT *,&lt;BR /&gt;-- Create FullIPv6 (8 blocks of 4 digits)&lt;BR /&gt;CONCAT(&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 1), ':', -1), 4, '0'), ':',&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 2), ':', -1), 4, '0'), ':',&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 3), ':', -1), 4, '0'), ':',&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 4), ':', -1), 4, '0'), ':',&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 5), ':', -1), 4, '0'), ':',&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 6), ':', -1), 4, '0'), ':',&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 7), ':', -1), 4, '0'), ':',&lt;BR /&gt;LPAD(SUBSTRING_INDEX(SUBSTRING_INDEX(NewIPv6_Patched, ':', 8), ':', -1), 4, '0')&lt;BR /&gt;) AS FullIPv6&lt;BR /&gt;FROM (&lt;BR /&gt;SELECT *,&lt;BR /&gt;CASE WHEN LEFT(IPaddress, 1) = ',' THEN SUBSTRING(IPaddress, 2) ELSE IPaddress END AS NewIP,&lt;BR /&gt;TRIM(SUBSTRING_INDEX(IPaddress, ',', 1)) AS NewIPAddress,&lt;BR /&gt;CASE WHEN INSTR(TRIM(SUBSTRING_INDEX(IPaddress, ',', 1)), ':') &amp;gt; 0 THEN 'IPv6' ELSE 'IPv4' END AS ip_type,&lt;BR /&gt;CASE&lt;BR /&gt;WHEN INSTR(TRIM(SUBSTRING_INDEX(IPaddress, ',', 1)), ':') = 0&lt;BR /&gt;THEN TRIM(SUBSTRING_INDEX(IPaddress, ',', 1))&lt;BR /&gt;END AS IpAddress_ipv4,&lt;BR /&gt;CASE&lt;BR /&gt;WHEN (LENGTH(TRIM(SUBSTRING_INDEX(IPaddress, ',', 1))) -&lt;BR /&gt;LENGTH(REPLACE(TRIM(SUBSTRING_INDEX(IPaddress, ',', 1)), ':', ''))) &amp;lt; 7&lt;BR /&gt;THEN CONCAT(&lt;BR /&gt;TRIM(SUBSTRING_INDEX(IPaddress, ',', 1)),&lt;BR /&gt;REPEAT(':0', 8 - (LENGTH(TRIM(SUBSTRING_INDEX(IPaddress, ',', 1))) -&lt;BR /&gt;LENGTH(REPLACE(TRIM(SUBSTRING_INDEX(IPaddress, ',', 1)), ':', '')))&lt;BR /&gt;))&lt;BR /&gt;ELSE TRIM(SUBSTRING_INDEX(IPaddress, ',', 1))&lt;BR /&gt;END AS NewIPv6_Patched&lt;BR /&gt;FROM daily_player&lt;BR /&gt;) a&lt;BR /&gt;) b where ip_type='IPv6' and `date` ='2025-01-01'&lt;BR /&gt;and NewIPAddress = '2001:268:7394:5b'&lt;BR /&gt;) c order by IPNumtest desc;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="poojashribanger_1-1750071397977.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/181340i44A5405112FEB4B6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="poojashribanger_1-1750071397977.png" alt="poojashribanger_1-1750071397977.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally, I’ve downloaded an IPv6-to-country mapping file and am using IntervalMatch() in Qlik to associate these numeric IPs to countries.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;BR /&gt;Poojashri&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jun 2025 10:59:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/IP-address-to-country-amp-City-mapping/m-p/2521271#M106532</guid>
      <dc:creator>poojashribanger</dc:creator>
      <dc:date>2025-06-16T10:59:59Z</dc:date>
    </item>
  </channel>
</rss>

