Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikcook
Contributor III
Contributor III

Looping over table and doing lookup in script editor

Hi there!

I am preparing a data set which resides in two database tables associated by a common attribute ("CPN").

Table A (warehouse qty on hand):
[ProdID]
[QOH]

Table B (products needed):
[ProdID]
[Deadline]
[QTY] (always = 1)
Order By [Deadline] asc

I need to conduct a lookup for each row between Table A and Table B and for each row to subtract [QTY] from [QOH].
Table B is ordered by [Deadline] as I need the products with the closest deadline to be treated first.

Imagined outcome:
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.

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).

Hope someone is able to crack the case.

0 Replies