Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

writing to conf files from UI

Hello,

We are using a *.conf files for a set of parameters we are using in our models.

parameters such as number of days back to load to, which field to use as a watermark, how many days of data to keep and etc.

I would like to know, if this parameters are loaded into the variable list when the model is reloaded, is there a way to modify them and affect the conf file?

or is it a one way mechanism?

Regards,

Boris

5 Replies
Michiel_QV_Fan
Specialist
Specialist

Basicaly QlikView is a one way system. You can of course write to qvd and txt files.

Maybe my solution for the binary load can get you started: Binary load, hidden script, changing file name

let me know if you can read the contents because its in the dutch user group

Not applicable
Author

Can't access it.

aren't conf files are like txt files?

Michiel_QV_Fan
Specialist
Specialist

Using a multiple QlikView enviroment probably makes use of binary loads in one ore more cases.

When a datamodel is changing regularly, a version number in the filename is needed and a hidden script in the next QlikView application is needed you might not be able to easily change the binary load statement.

With a few variables and a text file this can be achieved.

Consider this environment:

Datamodel -> binary load --> Dashboard

  • In your datamodel add the following variables:

let vWorkbooks = 'c:\data\project\workbooks';    your custom locations of course let vDashboard = 'c:\data\project\includes';let binary_file = DocumentName();let binary_file_to_load = '$(vWorkbooks)'&'\'&DocumentName();

  • Create a text file with the location where the datamodel is stored and it's current file name:

Binary_file:Load '' as 'BINARY $(binary_file_to_load);'AutoGenerate 1;

  • Store this text file in the desired location:

store Binary_file into $(vDashboard)\Binary_file.txt (txt);

  • In your dashboard add this as the first line of your (hidden) script

$(Include=binary_file.txt);
Resume:

  • the latest loaded datamodel will be loaded in the dashboard
  • the datamodel version can be added to the filename
  • hidden script doesn't have to be edited
Not applicable
Author

Correct me if I'm wrong, you are actually loading a whole text file into a QVD and then writing it back as a whole to the same file?

Thus the changes you want to make are done in the QVD? then when are the changes are copied back into the file?

Michiel_QV_Fan
Specialist
Specialist

No, this solution I designed creates a text file with an header name and an empty row. The header row is written, along with the empty row to a text file. This is created on the fly.

You could change the output form my solution 'DocumentName' to a value.

Alternatively, this might also do the trick: create a table in QlikView with the values that need to be saved and store that with a macro in a file.

This macro can be used for that:

Sub ExportToFile

'Download Sheet ojbect data to CSV

set sObject = ActiveDocument.GetSheetObject("CH03")

sObject.Export "C:\Lokale .....\*.csv", ", " 

End Sub

change the GetSheetObject to your chart and of course the target directory