Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I'm trying to use the name of an app to determine where my data should be loaded from. The idea is that if an app has a ' Dev' at the end of it, i.e. 'Dashboard Dev', then data should be loaded from the development environment, else it should load from the production environment.
The 'Dashboard Dev' app will be published to a Shared Space, whereas the 'Dashboard' app will be published to the Managed Space.
So basically I'd like to use the Shared Space as the development environment and the Managed Space as the production environment.
My idea was to have a small script section in the beginning of the load script that reads something like this:
LET vDocumentTitle = DocumentTitle();
IF '$(vDocumentTitle)' = 'Dashboard Dev'
THEN
SET vLibConnection = 'Shared Space Name:Dashboard_Azure_Dev';
SET vDatabaseName = 'Database_Dev';
ELSE
SET vLibConnection = 'Shared Space Name:Dashboard_Azure_Prod';
SET vDatabaseName = 'Database_Prod';
END IF
This would then let me use variables in the following load script:
LIB CONNECT TO "$(vLibConnection)";
[Dim_Customer]:
LOAD *;
SELECT *
FROM "$(vDatabaseName)".qlik."Dim_Customer";
The latter works fine. It's the first IF...THEN...ELSE statement that fails.
It fails around the THEN statement. Any ideas as to what I'm doing wrong?
Thank you very much in advance.
Bring the 'THEN' in the same line as of 'IF' - it should work fine then.
Bring the 'THEN' in the same line as of 'IF' - it should work fine then.
Perfect, thank you! That did the trick!
I was going out of my mind 😂