Hi.
I am trying to load data from multiple qvd:s and then save it like
LET Start = AddMonths(makedate(year(Today()), 1, 1),0);
LET End = AddMonths(makedate(year(Today()), 12, 31),0);
do while Start <= End
let YearMM = Year(date('$(Start)','YYYY-MM-DD'))*100+Month(date('$(Start)','YYYY-MM-DD'));
NoConcatenate
TMP:
LOAD
Field1,
Field2,
Field3
from [path/File_$(YearMM).qvd]
(qvd);
left Join(TMP)
Load
FROM [Path/file2.qvd]
(qvd);
left join(TMP)
load distinct
Field1
max(YearMM) as YearMM,
1 as MaxYearMM
resident TMP
group by Field1;
NoConcatenate
EndTable:
load
*
resident TMP
where MaxYearMM=1;
Drop Table TMP;
LET Start = date(AddMonths('$(Start)',1),'YYYY-MM-DD');
LOOP
store EndTable into [Path/endfile.qvd] (qvd);
But i can not get the loop logic to work so at the end it would go correctly. Any tips how to fix?