Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a issue.
I load data in many flat files, and I need to move these flat files after the load in an other directory.
My code is :
for each File in filelist ('$(pathData)files for reports\Casino\Casino*.csv')
//for each File in filelist ('$(pathData)files for reports\Casino\Casino_$(DBName)*.csv')
if isnull(NoOfRows('STATS_CASINO')) then
LoadPrefix='STATS_CASINO:';
else
LoadPrefix='CONCATENATE (STATS_CASINO)';
end if
$(LoadPrefix)
LOAD
'USERS_MARGE' as "Datasource",
'casino' as "Universe code marge",
// dayname(makedate(left(DATE,4),mid(DATE,6,2),right(DATE,2))) as "User Marge Date",
dayname(alt(date#(DATE,'DD-MM-YYYY'),
date#(DATE,'YYYY.MM.DD'),null())) as "User Marge Date", // 2 different formats (historic and daily files)
hash128(dayname(alt(date#(DATE,'DD-MM-YYYY'),date#(DATE,'YYYY.MM.DD'),null())),'$(BusinessName)') as KEY_BUSINESS_DATE,
lower(USERNAME) as "User Pseudo",
// GameWin as "Margin (EUR)"
BET-WIN-JackpotCosts as "Margin (EUR)",
BET-WIN-JackpotCosts-Bonus as "Result (EUR)"
FROM [$(File)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq)
;
let buf = [$(File)];
let buf2 = [$(pathData)files for reports\Casino\Charge\];
execute cmd.exe move $(buf)$(buf2);
exit script;
next File
The path data is a value of Qlikview which can be change and we need $(pathData)
My problem is when a lunch the code the execute don't works, I think is because CMD need " and I don't know use them in qlikview.
Can you help me please?
Kind regards
Bruno
I have found 🙂
The good version is :
let buf54 = '$(File)';
let buf55 = '$(pathData)'&'files for reports\Casino\Charge\';
execute cmd.exe /c move "$(buf54)" "$(buf55)";
Thank you for your help
Hi,
try this
execute cmd.exe /c move & '"' &$(buf) & '"' & ' "' & $(buf2) & '"';
i think its because you have spaces in your path and/or filename
Mansyno
Hi ,
I have try this
let buf = [$(File)];
let buf2 = '$(pathData)files for reports\Casino\Charge\';
execute cmd.exe move & '"' &$(buf) & '"' & ' "' & $(buf2) & '"';
and
let buf = [$(File)];
let buf2 = [$(pathData)files for reports\Casino\Charge\];
execute cmd.exe move & '"' &$(buf) & '"' & ' "' & $(buf2) & '"';
But it's don't change 😞
I have found 🙂
The good version is :
let buf54 = '$(File)';
let buf55 = '$(pathData)'&'files for reports\Casino\Charge\';
execute cmd.exe /c move "$(buf54)" "$(buf55)";
Thank you for your help