Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Move flat files with Path data

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

1 Solution

Accepted Solutions
Not applicable
Author

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

View solution in original post

3 Replies
wizardo
Creator III
Creator III

Hi,

try this

execute cmd.exe /c move & '"' &$(buf) & '"' & ' "' & $(buf2) & '"';


i think its because you have spaces in your path and/or filename

Mansyno
Not applicable
Author

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 😞

Not applicable
Author

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