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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewforum
Creator II
Creator II

QVW to create bat file which contain the copy command for all the QVD's used in the QVW. Help on this!

Hi,

To verify the data of a dashboard in Development after our changes we usually copy all the QVD's from Production environment to the Development environment and then we refresh the dashboard in Development with these QVD's to make sure that the data in

the dashboard is matching with Production.

Development: \\GRRTYRTSDDGDFH\QVSTORAGE_DEV\QV\APP\QVD\Sales.qvd

Production: \\TRUTRUSDGEDRUYER\QV\APP\QVD\Sales.qvd

In my case since difference between the Development and Production environment is only the root path. I was trying to create a batch file using the below code to create the copy command for all the files that exists in the dashboard. So when we run the batch

file which was created it would copy all the files from Production to Development.

Since double quotes(") required start and end of the source/destination files. I was trying to add the double quotes but I am getting extra double quotes in the start and end of the source/destination files.

Below is the code which I have written for this. Can someone please help on this?

mytable:
LOAD
'COPY /Y   ' & '"'&Replace(Upper(Discriminator),'\\GRRTYRTSDDGDFH\QVSTORAGE_DEV\QV\','\\TRUTRUSDGEDRUYER\QV\') & '"'&'   ' &'"'&Upper(Discriminator) & '"'as CopyCommand
FROM [\\TRUTRUSDGEDRUYER\QV\APP\QVW\Medical_Sales.qvw](XmlSimple, Table is [DocumentSummary/LineageInfo])
where right(Discriminator,3)='qvd'
;

store * from mytable into myfile.bat (txt);

13 Replies
marcus_sommer

To read files witin a loop is in HELP a good example available (for each ... --> dirlist/filelist). To copy from a txt-file see here: http://stackoverflow.com/questions/6257948/batch-copy-a-list-txt-of-files

- Marcus

qlikviewforum
Creator II
Creator II
Author

I already have list of the QVD's which need to be copied so I don't need any loop now. Only issue which I have mentioned in my first post was the extra double quotes which I am getting. If I fix that my code looks good. Hope my requirement is understandable now.

marcus_sommer

If you used another delimiter as comma and avoids any quotes inside the output you won't be have extra double-quotes. There will be no other way within qv. But you could run another batch which could clean/prepare your first batch-file.

- Marcus

qlikviewforum
Creator II
Creator II
Author

Thanks Marcus... I will try this thing out and will update you.... Thanks for all your help!