<?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: Assign values in one table based on another table in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Assign-values-in-one-table-based-on-another-table/m-p/1855752#M9809</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Interesting problem! My approach to this would be to assign a counter ID for each Invoice based on the Customer and row number. So the very first invoice for Customer A would be 'A1', and so on. You could do this with a combination of Peek() and RangeSum() functions as explained in this blog:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Counters-in-the-Load/ba-p/1464117" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Counters-in-the-Load/ba-p/1464117&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I would then by expand out the Users tables, so that there are 30 rows for User ID =1234, Customer =A. and 5 rows for&amp;nbsp;User ID =23456, Customer =B, and perform the same counters, A1, A2, A3 etc up to A&amp;lt;MaxRows&amp;gt;. You can user the IterNo() function to do this expansion.&lt;/P&gt;
&lt;P&gt;Once this is done the two tables will associated with each other on the counter ID field. (or you could join them if you wanted to)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See attached qvf file, I hope this help you to find a solution even if this isn't exactly it.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Ben&lt;/P&gt;</description>
    <pubDate>Thu, 04 Nov 2021 19:45:07 GMT</pubDate>
    <dc:creator>BenjaminT</dc:creator>
    <dc:date>2021-11-04T19:45:07Z</dc:date>
    <item>
      <title>Assign values in one table based on another table</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Assign-values-in-one-table-based-on-another-table/m-p/1855294#M9799</link>
      <description>&lt;P&gt;I have 2 tables. One table contains Invoices that need to be assigned to a user based on data in another table.&lt;/P&gt;
&lt;P&gt;Example Data:&lt;/P&gt;
&lt;P&gt;Table A - Invoices&lt;/P&gt;
&lt;P&gt;InvoiceId = 123456, Customer = A&lt;/P&gt;
&lt;P&gt;InvoiceId = 456789, Customer = B&lt;/P&gt;
&lt;P&gt;InvoiceId = 678910, Customer = A&lt;/P&gt;
&lt;P&gt;Table B - Users&lt;/P&gt;
&lt;P&gt;User ID = 1234, Customer =A, MaxRows = 30&lt;/P&gt;
&lt;P&gt;UserID = 23456, Customer = B, MaxRows = 5&lt;/P&gt;
&lt;P&gt;I need to assign each Invoice record to a user for that Customer, but limit the # of Invoices that get assigned based on the MaxRows value for each user.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas? I have about 1,900 records per day so the dataset isn't very large.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2021 21:32:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Assign-values-in-one-table-based-on-another-table/m-p/1855294#M9799</guid>
      <dc:creator>LisaDrummond</dc:creator>
      <dc:date>2021-11-03T21:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values in one table based on another table</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Assign-values-in-one-table-based-on-another-table/m-p/1855752#M9809</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Interesting problem! My approach to this would be to assign a counter ID for each Invoice based on the Customer and row number. So the very first invoice for Customer A would be 'A1', and so on. You could do this with a combination of Peek() and RangeSum() functions as explained in this blog:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Qlik-Design-Blog/Counters-in-the-Load/ba-p/1464117" target="_blank"&gt;https://community.qlik.com/t5/Qlik-Design-Blog/Counters-in-the-Load/ba-p/1464117&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I would then by expand out the Users tables, so that there are 30 rows for User ID =1234, Customer =A. and 5 rows for&amp;nbsp;User ID =23456, Customer =B, and perform the same counters, A1, A2, A3 etc up to A&amp;lt;MaxRows&amp;gt;. You can user the IterNo() function to do this expansion.&lt;/P&gt;
&lt;P&gt;Once this is done the two tables will associated with each other on the counter ID field. (or you could join them if you wanted to)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See attached qvf file, I hope this help you to find a solution even if this isn't exactly it.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Ben&lt;/P&gt;</description>
      <pubDate>Thu, 04 Nov 2021 19:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Assign-values-in-one-table-based-on-another-table/m-p/1855752#M9809</guid>
      <dc:creator>BenjaminT</dc:creator>
      <dc:date>2021-11-04T19:45:07Z</dc:date>
    </item>
  </channel>
</rss>

