Discussion Board for collaboration on QlikView Scripting.
I need assistance with interval match and peek function.
Given below are table 1 & table 2 we have four fields in table 1 and the requirement is to insert the date
field of table 2 with the start date & end date fields of table 1 using interval match such that you
join the two tables and the output table should contain the fields work center, date , capacity where only unique
records of work center without duplication.
Other requirement is from the table below, i need to get the last working date of the work center from start date by comparing the next record using interval match and peek function.
the output table should be like
Your assistance will be highly appreciated.
Go to Solution.
please use below script and change the path of the excel sheets that should solve your issue:
LOAD [Work center],
(ooxml, embedded labels, table is Sheet1);
(ooxml, embedded labels, table is Sheet2);
if(len(Peek([Start date]))=0 or [Work center]<>peek([Work center]),'1/1/2020',date(peek([Start date])-1)) as End_date,
order by [Work center], [Start date] desc;
drop table Temp_Capacity;
left join (Final)
Resident Cap2 ;
I worked out solution for your problem. Please see the attached .qvw. Please mark it as answered to close this thread if you find the solution helpful.