<?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: Mapping Account Numbers based on a Range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Mapping-Account-Numbers-based-on-a-Range/m-p/265733#M706760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use IntervalMatch function to map the Account group.&lt;/P&gt;&lt;P&gt;In your example Account codes 100001 will be mapped to Group 1, 100005 will be mapped to Group 1 as well, similarily account code 350001 will be mapped to Group 4. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2012 03:29:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-09T03:29:36Z</dc:date>
    <item>
      <title>Mapping Account Numbers based on a Range</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Account-Numbers-based-on-a-Range/m-p/265732#M706759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to map a range of account numbers to a group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Account Groups Exaample:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 535px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl65" height="20" style="text-align: center;" width="174"&gt;AccountCodeStartRange&lt;/TD&gt;&lt;TD class="xl65" style="text-align: center;" width="203"&gt;AccountCodeEndRange&lt;/TD&gt;&lt;TD class="xl65" style="text-align: center;" width="158"&gt;AccountType&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="text-align: center;"&gt;100000&lt;/TD&gt;&lt;TD align="right" style="text-align: center;"&gt;199999&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;Group 1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="text-align: center;"&gt;200000&lt;/TD&gt;&lt;TD align="right" style="text-align: center;"&gt;299999&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;Group 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="text-align: center;"&gt;300000&lt;/TD&gt;&lt;TD align="right" style="text-align: center;"&gt;350000&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;Group 3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20" style="text-align: center;"&gt;350001&lt;/TD&gt;&lt;TD align="right" style="text-align: center;"&gt;350001&lt;/TD&gt;&lt;TD style="text-align: center;"&gt;Group 4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333333;"&gt;Account Data&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Account Code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account Name&lt;/P&gt;&lt;P&gt;100001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account 1&lt;/P&gt;&lt;P&gt;100005&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account 2&lt;/P&gt;&lt;P&gt;100010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account 3&lt;/P&gt;&lt;P&gt;350001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Account xxx&lt;/P&gt;&lt;P&gt;etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although the ranges are wide there may only be 5 or 10 accounts in each range and they are frequently changing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone think of an efficient way to map the accounts to the account group ranges in the load script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ps The Account Groups are loaded from a spreadsheet and the Account Data is loaded from a separate database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 02:46:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Account-Numbers-based-on-a-Range/m-p/265732#M706759</guid>
      <dc:creator />
      <dc:date>2012-02-09T02:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping Account Numbers based on a Range</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Account-Numbers-based-on-a-Range/m-p/265733#M706760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use IntervalMatch function to map the Account group.&lt;/P&gt;&lt;P&gt;In your example Account codes 100001 will be mapped to Group 1, 100005 will be mapped to Group 1 as well, similarily account code 350001 will be mapped to Group 4. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 03:29:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Account-Numbers-based-on-a-Range/m-p/265733#M706760</guid>
      <dc:creator />
      <dc:date>2012-02-09T03:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Mapping Account Numbers based on a Range</title>
      <link>https://community.qlik.com/t5/QlikView/Mapping-Account-Numbers-based-on-a-Range/m-p/265734#M706761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant! I was going to build a temporary table and populate every number between the ranges then join them. So glad I asked! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; Thanks for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For anyone else here is the proof of concept code I used...(Thanks to the great work from John too &lt;A _jive_internal="true" href="https://community.qlik.com/thread/31385"&gt;http://community.qlik.com/thread/31385&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is the test data load. The account number here should map into the AccountGrouping Account Number ranges&lt;/P&gt;&lt;P&gt;TestData:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AccountNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AccountName&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\lukec.ADVANCE\Desktop\Integration\IntegrationAccountMapping.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [TestData]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This table contains the Account Ranges from the Chart Of Accounts so user can easily group a range of accounts into buckets.&lt;/P&gt;&lt;P&gt;AccountGrouping:&lt;/P&gt;&lt;P&gt;LOAD AccountCodeStartRange, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccountCodeEndRange, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccountType, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AccountDefaultSign&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\lukec.ADVANCE\Desktop\Integration\IntegrationAccountMapping.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [AccountGrouping]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This table contains the list of valid accounttypes&lt;/P&gt;&lt;P&gt;AccountType:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AccountType,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StatementGroup,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SortOrder&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\lukec.ADVANCE\Desktop\Integration\IntegrationAccountMapping.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [AccountType]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//The IntervalMatch basically finds account number from the Actual data (AccountNumber) that fits into the AccountGrouping range defined below. e.g. between AccountCodeStartRange and AccountCodeEndRange&lt;/P&gt;&lt;P&gt;//If the account number fit within the range then the tables are joined. N.B. it does not join the entire table. See left join below.&lt;/P&gt;&lt;P&gt;LEFT JOIN (TestData)&lt;/P&gt;&lt;P&gt;INTERVALMATCH (AccountNumber)&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AccountCodeStartRange,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;AccountCodeEndRange&lt;/P&gt;&lt;P&gt;RESIDENT AccountGrouping;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//This is the important bit. You have to left join again to the Data Table to get all the additional fields from the Range Table.&lt;/P&gt;&lt;P&gt;LEFT JOIN (TestData)&lt;/P&gt;&lt;P&gt;LOAD *&lt;/P&gt;&lt;P&gt;RESIDENT AccountGrouping;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Not drop the range table so you don't get extra links.&lt;/P&gt;&lt;P&gt;DROP Table AccountGrouping;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 05:05:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Mapping-Account-Numbers-based-on-a-Range/m-p/265734#M706761</guid>
      <dc:creator />
      <dc:date>2012-02-09T05:05:22Z</dc:date>
    </item>
  </channel>
</rss>

