Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Highlighted
volkanburc
New Contributor

For Loop and SubField

Hi.

I would like to draw multiple files in the For loop based on the date value in the file path. What's the problem with my code?

SET CONCATENATE=;
SUB SCANFOLDER(ROOT)
FOR Each EXT in 'xlsx'
LOAD
BİLANÇO AS GT2
FROM [$(FoundFile)](ooxml, embedded labels,table is [Aktif Detay]);
LET vTitle2=FieldValue('GT2',2);
LET vYear=SubField(FieldValue('GT2',2),'.',4);
Let vMonth=SubField(FieldValue('GT2',2),'.',5);
FOR Each FoundFile in FileList(ROOT&'\*'&EXT);
FileList:
$(CONCATENATE)
LOAD *,
$(vMonth)&'.'&$(vYear) AS Yil
FROM
[$(FoundFile)](ooxml, embedded labels, header is 5 lines, table is [Aktif Detay])
WHERE
[Şirket Kodu]<9000 AND IsNull([Şirket Kodu])=0;
SET CONCATENATE = concatenate;
NEXT FoundFile
NEXT EXT

FOR Each SubDirectory in DirList(ROOT&'\*')
CALL ScanFolder(SubDirectory)
NEXT SubDirectory
END SUB

CALL SCANFOLDER('C:\Users\vsatilmis\Desktop\SigortaForLoop')

Community Browser