Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've set up my first Qlik Sense environment with QDF.
Since I'm using shared persistance I've put the QDF folder structure into that shared folder right beside the built-in Apps-folder.
To support a test and prod flow I did it this way:
1. First I created one folder named Test and another named Prod and put two complete QDF-folder structures in there with prefixes calles like Sales_Test and Sales_Prod.
2. Then I created folder-connections on the Qlik Sense server for each container in each QDF-structure for example
Sales_Test pointing to \\QLikShare\Test\4.Sales
and
Sales_Prod pointing to \\QLikShare\Prod\4.Sales
3. Then I implemented a way to automatically update a vEnvironment-variable depending on if the app is published to prod or test according to this post Multi-tier deployment in a single environment - let apps automatically know which datasources to use...
4. It is only the config-files and the qvd-files that are handled by the QDF since the applications in Qlik sense are restored into the apps-folder with a cryptic name.
Everything works nicely but then when I put some geo-files into the shared folder I realized that the Shared folder in QDF is hard-coded into the 1.init.qvs script like this:
SET vL.QDF.LinkShared_Folders = 'Shared';
Which means that the shared folder cannot have a prefix like Shared_Test or Shared_Prod.
For now I make use of the AltPath-option and have only one single shared folder common to both test and prod.
Anyone else who have thought of how to config the shared folder in a test/prod usage of QDF for Qlik sense?
Hi,
Yes it works like a charm now.
I put the
Call LCGV('Shared','','Shared_$(vEnvironment)');
into each containers 4.Custom.qvs and now I have two separate environments for test and prod don't need to edit a thing when poublishing to prod since I implemented this.
Thanks for your hint of 4.Custom.qvs
/Andreas
Hi Andreas, Shared folder is just like any container except that initiates during load (as you stated) you can just as well initiate the shared container "manually" (adding your dynamic name setting) by adding aditional Call after initiation,
Call LCGV('Shared','','Shared_Test');
To make things even smother add this line into 99.shared_folders\3.Include\1.BaseVariable\4.Custom.qvs and this will be executed if shared container is available. Only drawback is that you will have two different global variables pointing to the same container.
Hope that this helps?
Regards
Hi Magnus,
Thanks for that idea.
In that scenario I first have to create a data-connection called just "Shared" in Qlik Sense where that script resides, where should that point?
Perhaps pointing that to the //QlikShare//prod/99.shared_folders and put something like
IF(vEnvironment='Prod') then
Call LCGV('Shared','','Shared_Prod');
ELSE
Call LCGV('Shared','','Shared_Test');
ENDIF
into its 3.Include\1.BaseVariable\4.Custom.qvs
Regards
Or just add the variablein the function
Call LCGV('Shared','','Shared_'&$(vEnvironment));
Regards
Magnus
Two things
1. I have no problem with the LCGV call (other than the bug in 1.7.0 mentioned below) But when you said: "To make things even smother add this line into 99.shared_folders\3.Include\1.BaseVariable\4.Custom.qvs and this will be executed if shared container is available."
I cannot see how that shall work without having a dataconnection named Shared in Qlik Sense and I have only Shared_Test and Shared_Prod. Either I put that call in the app itself or in the different containers corresponding \3.Include\1.BaseVariable\4.Custom.qvs, its not a big deal just that I understood the setup correctly.
2. I suspect a bug in the file 3.Sales\3.Include\4.Sub\4.GenericContainerLoader.qvs
This line won't do much
let vL.QDF.Alias= PurgeChar(trim('$(vL.QDF.Alias)'),'=;,- '&chr(39));
It should rather be
let vL.QDF.ContainerName= PurgeChar(trim('$(vL.QDF.Alias)'),'=;,- '&chr(39));
The impact is that Call LCGV('Shared','','Shared_Prod');, don't work.
I put a pull-request here
Best regards
Hi Andrea's, thanks for spotting this did the Alias work after your correction? My idea was that you would have shared global variables (as they are needed for several things) and in addition add the shared alias (share_test share_prod)
Hope that this helps.
Regards
Hi,
Yes it works like a charm now.
I put the
Call LCGV('Shared','','Shared_$(vEnvironment)');
into each containers 4.Custom.qvs and now I have two separate environments for test and prod don't need to edit a thing when poublishing to prod since I implemented this.
Thanks for your hint of 4.Custom.qvs
/Andreas
Great, so the fix you made should then go into the main build?
Cheers
Yes. At least according to my knowledge.
brgds
Hi Andreas, I reviewed and tested the main branch code (without your fix) and could not spot anything wrong, for me the alias works just fine, wounder what differs? Could you run on an older code version? Could you please take 4.GenericContainerLoader.qvs from github main build and test it in your environment?
Regards
Magnus