Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Let foldername = SubField(DIR,'\',-1) ;
HIC
Thank you Henric.