Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone!!
I have the following tables
Table1: on this table i would like to be able to add the information about Delivery Number and Delivery Date that are saved on another table (Table 2).
The join from table 2, needs to be done using Item + Location + Lotn and then assign the most recent Delivery Number and Delivery Date to the table 1 - so the rows highlighted in green should be reported in the table1.
Complexity of this, is that if for an item-lot-location i have 2 (or maybe more records, as it is for item B-NewYork-CC12) i have to first assign the most recent value (1239038) and then the less recent value (1928397). It's like a chronological assignemnt.
Does anyone know if this can be achieved with qlikview?
Thanks!!!
Using the first four records in Table2 to exemplify
Table1:
load * From Table1;
Table2:
Load * Inline[
ITEM,LOCATION,LOTN,DELIVERY NUMBER,DELIVERY DATE
A,SYDNEY,AKJI202,12890,10/01/2022
B,NEW YORK,CC12,13190,12/01/2022
B,NEW YORK,CC12,13490,14/01/2022
C,PARIS,AB88,13790,16/01/2022
C,PARIS,AB88,14090,18/01/2022
];
Left Join(Table1)
LOAD ITEM,
LOCATION,
LOTN,
Max([DELIVERY NUMBER]) as [DELIVERY NUMBER],
MAX([DELIVERY DATE]) as [DELIVERY DATE]
Resident Table2
Group By ITEM,
LOCATION,
LOTN
Order By ITEM;
DROP TABLE Table2;
EXIT SCRIPT;