Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
benvatvandata
Partner - Creator II
Partner - Creator II

Dynamic Script to Load/Update Tables?

Hi,

I have a script that does what I want for 1 table in my whole document... but there are a ton of tables so I'd like to figure out how to write a dynamic script to update all the tables in a similar fashion.

Basically, I have a temporary Link table (LinkNew) that holds all the primary keys in each table (i.e. %BillLineKey, %ItemKey, %SOrderLineKey, %InventoryKey, etc.), and I'm using that to update which keys/records should be included in all the new tables.

This is the part of my script I'd like to be dynamic:

 

Left Join(Billing)
LOAD Distinct %BillLineKey,
%BillLineKey as %BillLineKey2
Resident LinkNew;

NoConcatenate
Billing2:
LOAD *
Resident Billing
where %BillLineKey <> %BillLineKey2;

Drop Table Billing;
Drop field %BillLineKey2 from Billing2;

 

 

So the above example was for updating my Billing table... is there a way to loop through each table and do this dynamically?

 

Thanks,

Ben

Labels (1)
1 Reply
benvatvandata
Partner - Creator II
Partner - Creator II
Author

So just to add another example... after it updates my Billing table, it would then do the following for the next table (i.e. SOrderLine):

Left Join(SOrderLine)
LOAD Distinct %SOrderLineKey,
%SOrderLineKey as %SOrderLineKey
Resident LinkNew;

NoConcatenate
SOrderLine2:
LOAD *
Resident SOrderLine
where %SOrderLineKey <> %SOrderLineKey2;

Drop Table SOrderLine;
Drop field %SOrderLineKey2 from SOrderLine2;

 

Thanks,

Ben