<?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 Iterating on data between two tables in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Iterating-on-data-between-two-tables/m-p/1799295#M64733</link>
    <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;I am preparing a data set which resides in two database tables associated by a common attribute ("CPN").&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Table A (warehouse qty on hand):&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;[ProdID]&lt;BR /&gt;[QOH]&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Table B (products needed):&lt;/STRONG&gt;&lt;BR /&gt;[ProdID]&lt;BR /&gt;[Deadline]&lt;BR /&gt;[QTY] (always = 1)&lt;BR /&gt;Order By [Deadline] asc&lt;/P&gt;&lt;P&gt;I need to conduct a lookup - for each row - between Table A and Table B and for each row to subtract [QTY] from [QOH].&lt;BR /&gt;Table B is ordered by [Deadline] as I need the products with the closest deadline to be treated first.&lt;BR /&gt;&lt;BR /&gt;Imagined outcome:&lt;BR /&gt;Option 1) A flag in Table B which indicates if QOH for a ProdID has reached zero. I will then be able to create a list of products we're able to produce with the current warehouse QOH stats.&lt;/P&gt;&lt;P&gt;Option 2) A column in Table B stating what the adjusted QOH is for the record's ProdID (okay if it's a negative number).&lt;/P&gt;&lt;P&gt;Hope someone is able to crack the case.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 00:15:31 GMT</pubDate>
    <dc:creator>qlikcook</dc:creator>
    <dc:date>2024-11-16T00:15:31Z</dc:date>
    <item>
      <title>Iterating on data between two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Iterating-on-data-between-two-tables/m-p/1799295#M64733</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;I am preparing a data set which resides in two database tables associated by a common attribute ("CPN").&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;Table A (warehouse qty on hand):&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;[ProdID]&lt;BR /&gt;[QOH]&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Table B (products needed):&lt;/STRONG&gt;&lt;BR /&gt;[ProdID]&lt;BR /&gt;[Deadline]&lt;BR /&gt;[QTY] (always = 1)&lt;BR /&gt;Order By [Deadline] asc&lt;/P&gt;&lt;P&gt;I need to conduct a lookup - for each row - between Table A and Table B and for each row to subtract [QTY] from [QOH].&lt;BR /&gt;Table B is ordered by [Deadline] as I need the products with the closest deadline to be treated first.&lt;BR /&gt;&lt;BR /&gt;Imagined outcome:&lt;BR /&gt;Option 1) A flag in Table B which indicates if QOH for a ProdID has reached zero. I will then be able to create a list of products we're able to produce with the current warehouse QOH stats.&lt;/P&gt;&lt;P&gt;Option 2) A column in Table B stating what the adjusted QOH is for the record's ProdID (okay if it's a negative number).&lt;/P&gt;&lt;P&gt;Hope someone is able to crack the case.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 00:15:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Iterating-on-data-between-two-tables/m-p/1799295#M64733</guid>
      <dc:creator>qlikcook</dc:creator>
      <dc:date>2024-11-16T00:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looping on data residing in two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Iterating-on-data-between-two-tables/m-p/1801058#M64933</link>
      <description>&lt;P&gt;Here is an example of how it can be done using Previous and Peek functions.&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Data:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;ProdID, StartingQOH&lt;BR /&gt;A, 6&lt;BR /&gt;B, 4&lt;BR /&gt;];&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Join&lt;BR /&gt;Load * Inline [&lt;BR /&gt;ProdID, Deadline, Qty&lt;BR /&gt;A, 1/09/2021, 2&lt;BR /&gt;A, 1/12/2021, 2&lt;BR /&gt;A, 3/21/2021, 1&lt;BR /&gt;A, 4/12/2021, 4&lt;BR /&gt;B, 1/06/2021, 1&lt;BR /&gt;B, 1/17/2021, 3&lt;BR /&gt;B, 2/16/2021, 2&lt;BR /&gt;];&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Join (Data)&lt;BR /&gt;Load ProdID,&lt;BR /&gt;Deadline,&lt;BR /&gt;If(ProdID = Previous(ProdID), Peek(RemainingQOH)-Qty, StartingQOH-Qty) as RemainingQOH&lt;BR /&gt;Resident Data&lt;BR /&gt;order by ProdID, Deadline;&lt;/P&gt;&lt;P&gt;The code above yields these results.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PreviousPeek.png" style="width: 428px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/53316iD0EA3EDB78207230/image-size/large?v=v2&amp;amp;px=999" role="button" title="PreviousPeek.png" alt="PreviousPeek.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 19:16:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Iterating-on-data-between-two-tables/m-p/1801058#M64933</guid>
      <dc:creator>Dalton_Ruer</dc:creator>
      <dc:date>2021-04-20T19:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: Looping on data residing in two tables</title>
      <link>https://community.qlik.com/t5/App-Development/Iterating-on-data-between-two-tables/m-p/1802023#M65054</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/49457"&gt;@Dalton_Ruer&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;What an elegant solution.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 07:31:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Iterating-on-data-between-two-tables/m-p/1802023#M65054</guid>
      <dc:creator>qlikcook</dc:creator>
      <dc:date>2021-04-23T07:31:57Z</dc:date>
    </item>
  </channel>
</rss>

