Wednesday 18 November 2015

Qlikview Management Console - Folder and Document list sorting

Our instance of qlikview has a lot of Documents and folders containing them.  We have setup a structure where each report has a sub folder of it's own with an application, data, config folder etc loosely based on the Qlikview Deployment Framework.

In the management console where setup Qlikview Server to find the folders we list out each report folder as a separate Mounted Folder rather than pointing to a top level.  This allows more customisation of structure in Qlikview.  eg.

We try to name the folders in a meaningful way, eg. Admin_...., Beverage_....., Procurement_.....  A problem we came across when setting this up was that as you add new folders, the simply go to the bottom of the list, rather than being sorted alphabetically.  Finding a relevant folder, either here or in the "Documents" tab is difficult when they run to 150+ reports.

I've not been able to find a way in Qlikview to get it to sort the folder names - at least not a standard method.  But have found the following process to allow it.  NOTE: Only done this on our test server as a check - haven't validated if there are any adverse consequences.  This blog is my instruction manual if / when decide to replicate to production.

a) Folder listings:
Management Console -> System -> Setup -> Qlikview Servers -> our Server -> Folders.  This is the list of folders on disk that contain .qvw files to be referenced.  Our Root Folder is a dummy folder as we are doing everything through Mounted folders.

To re-sort the mounted folder listing I found in this file:

"C:\ProgramData\QlikTech\QlikViewServer\Settings.ini" which controls the settings for Qlikview Server including the Mounted folder list.

Within that list is a row for "Document Mounts" that looks like this:


Each Mounted folder has three fields separated by comma: Mounted Name, the folder on disk and a Browserable (1) or not (0) flag.  A semi-colon seperates each Mounted folder.

I (after taking copies of the file as backup) copied the DocumentMounts= row out to Excel ( which is good for this type of thing ), split into multiple rows and fields.  I then sorted the rows and recreated the string based on the format that came out.

I pasted the string back into the settings.ini file and restarted services.  And it worked, the folders had re-aligned themselves.  Of course when I add the next one, will have to do it all again.


b) Document Listings.

Similar problem with the Documents -> User Documents tab.  I had hoped changing the folders list would copy across to here, but didn't appear to happen - or I didn't wait long enough for it to take effect?

To resort this one went to the QVPR dataset at

"C:\ProgramData\QlikTech\ManagementService\QVPR" folder.  There are a number of xml files here that control the settings (although you can do in a SQL server apparently).  The one of interest was "SourceDocumentFolderResource.xml".

Apart from some settings it lists a series of SourceDocumentFolderResource rows, one for each folder listed.  So within a text editor I simply sorted the rows alphabetically, restarted the Services (twice as first time didn't go so well), and voila, sorted list.

There should be minimal risk with these things as if you break the files, you can simply delete them (or return you previously stored copies) and Qlikview should re-generate them from a default.  The QVPR keeps .bak versions also of the xml.