Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
haymarketpaul
Creator III
Creator III

For each File - Syntax Error

QV12 SR4

The following code worked great for at least a year until i had my computer reimaged (win10 reinstall) and i had to reinstall Qlikview.  Now i get a syntax error that i can't fathom out.

The error occurs immediately after the line in red below.  There is a file called dbCIPS - All - Apr 9 2018 09-47-14 AM.CSV in the vSPOPAdPromo folder.

Any ideas most welcome.

The syntax Error...

Unexpected token: '\\HAMMSTORE\Direct\Circulation\Data', expected one of: '(', ',', ':', 'OPERATOR_PLUS', 'OPERATOR_MINUS', 'OPERATOR_MULTIPLICATION', 'OPERATOR_DIVISION', ...

FOR each File in filelist >>>>>>\\HAMMSTORE\Direct\Circulation\Data<<<<<< ops\CIPS\Silverpop Database\dbCIPS - All*.CSV

The code...

//Path to AdPromo Files

LET vSPOPAdPromo = '\\' & '$(vHammstore)' & '\Direct\Circulation\Data ops\CIPS\Silverpop Database\';

FOR each File in filelist $(vSPOPAdPromo)dbCIPS - All*.CSV

Folder:

LOAD

    '$(File)' as Name,

    FileTime( '$(File)' ) as FileTime

    autogenerate 1;

NEXT File

LatestAdPromoFile:

First 1

LOAD

    Name,

    SubField(Name,'\',SubStringCount(Name,'\')+1)    as FileNameOnly,

    FileTime,

    1 as dummy

Resident Folder

Order By FileTime DESC;

DROP Table Folder;

LET vLatestAdPromoFile = Peek('FileNameOnly',0,'LatestAdPromoFile');

LET vLatestAdPromoFileWithPath = Peek('Name',0,'LatestAdPromoFile');

DROP Table LatestAdPromoFile;

1 Solution

Accepted Solutions
sasiparupudi1
Master III
Master III

May be try like this

FOR each File in filelist ('$(vSPOPAdPromo)*.CSV')

Folder:

LOAD

    '$(File)' as Name,

    FileTime( '$(File)' ) as FileTime

    autogenerate 1;

NEXT File

View solution in original post

4 Replies
swarnendu
Creator II
Creator II

change the folder Path and reload it.

Hope so its will be work . i am also facing same issue in some month ago .

haymarketpaul
Creator III
Creator III
Author

No luck - same message i'm afraid

sasiparupudi1
Master III
Master III

May be try like this

FOR each File in filelist ('$(vSPOPAdPromo)*.CSV')

Folder:

LOAD

    '$(File)' as Name,

    FileTime( '$(File)' ) as FileTime

    autogenerate 1;

NEXT File

haymarketpaul
Creator III
Creator III
Author

Wonderful - thank you - works perfectly