Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Return folder name in a loop and use it to store QVD

Hi,

Thank you in advance.

I am generating historical qvd files, I want to get folder name without a fill path in a loop and use it to store to qvd file, see code below.


set DATADIR = '\\QlikViewServer\Data\';

for each DIR in dirlist('$(DATADIR)*')

set foldername = [please help here!!!]

for each CSV in filelist ('$(DIR)\*_SalesTransactions.CSV')

TMP:

LOAD

  @1 as a,

     @2 as b,

     @3 as c

FROM

[$(CSV)]

(txt, codepage is 1252, no labels, delimiter is ',');

next CSV;

store TMP into C:\Qlikview\QVData\SalesTransactions\$(foldername).qvd;

drop table TMP;

next DIR;

Within data directory I have monthly folders (see format examples below) with sales transactions per store for that month, looking at 3-4 years of data

August 2014

September 2014

October 2014

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

Let foldername = SubField(DIR,'\',-1) ;

HIC

View solution in original post

2 Replies
hic
Former Employee
Former Employee

Let foldername = SubField(DIR,'\',-1) ;

HIC

Not applicable
Author

Thank you Henric.