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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sunil2288
Creator III
Creator III

Can we have rename application using variable

Dear Qliktechies,

Here i have a question.

Can we rename an application while saving the Qlikview application using a variable value.

Let's say i have a variable

Let vAppName:- 'ABC'

//Let vAppName:- 'DEF'

//Let vAppName:- 'GHI'

And each time i uncomment one and comment the rest of two and reload the application will save with that variable name.

Here in this case after reloading the application it will be saved as ABC.

Can anyone help me out with this??

Regards

Sunil

11 Replies
marcus_sommer

From inside the app it would be only per macro possible (unless you used manually F12):

ActiveDocument.SaveAs "C:\Mydoc.qvw"

From an external point of view you could use a copy batch like:

copy „C:\MyApp“ „D:\Backup\MyAppXYZ“

- Marcus

Peter_Cammaert
Partner - Champion III
Partner - Champion III

I don't think you can use the ActiveDocument.SaveAs trick to block QlikView/QlikView Server from saving on top of the original document after a reload.

In QlikView Server, the reload will be saved to a temporary file, after which the Distribution Service will copy the temporary file back to the origjnal QVW.AFAIK the Distribution Service doesn't care about executing macro's.

If you plan to interactively do a reload in QV Desktop, then adding a macro that is triggered after the reload will probably fit your requirement.

Peter

ToniKautto
Employee
Employee

That sounds a bit like lop and reduce in QlikView Publisher, where you get multiple output files based on values in a field.

sunil2288
Creator III
Creator III
Author

Hej Marcus,
Thanks a lot for you quick reply
Is it possible to do something in the same script without doing it externally.

I have declared the variable inside the Load script only. So accessing variable after reloading @Server won't be a problem. But i need to access the Qlikview Application name (May be it is metadata ).

Regards

Sunil

sunil2288
Creator III
Creator III
Author

Hej Peter,

Thanks for your reply!

I need this functionality of dynamically renaming the application which means i just have to comment\uncomment the variable value "vAppName" and the application will be saved with the variable name after reloading the application in Server each time.

It can't be solved using Loop & Reduce as i am not reducing the application based on any value..


Can you please help me with this?

Regards

Sunil

sunil2288
Creator III
Creator III
Author

Hej Toni,

Thanks for your reply!

I need this functionality of dynamically renaming the application which means i just have to comment\uncomment the variable value "vAppName" and the application will be saved with the variable name after reloading the application in Server each time after reload.

It can't be solved using Loop & Reduce as i am not reducing the application based on any value..


Can you please help me with this?

Regards

Sunil

marcus_sommer

It's not possible while the load-execution to save the qvw - also the macro from above won't work because the ActiveDocument didn't exist to that time. But you could create various qvd-output which could be load from these qvw's.

What is the aim from these SaveAs?

- Marcus

IAMDV
Master II
Master II

Hi Sunil,

How about running a batch script through "Supporting Tasks" or normal task which does the rename after the reload is completed? This way you're not deviating QDS core job of distributing and saving the document. This might be a workaround but I'm not keen on having these things on PROD environment.

Hope this helps!

Cheers,

DV

www.QlikShare.com

ToniKautto
Employee
Employee

If you have a data island and reduce on a field that has no relation to the rest of the data, I guess you would not practically reduce the actual data.