Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Control Binary Load in Script

Is this possible?

I am doing a binary load in my app.

However, when I move my app from DEV to Prod I need to load a different app id for the same app.

So I put code in my script for both.  But I have to remember to manually change it when I move the app to Prod.

Is there a way in the script to identify which server I am on and automatically load the correct app id?

I tried an If statement but it didn't like that.  I was also thinking using a variable.  But you can't put that in front of the binary load statement.

Here is the code that I am currently using:

//DEV

Binary 'lib://QSApps/45d5cbab-2850-4633-bce1-79bb29716fad';

//PROD

//Binary 'lib://QSApps/02ff1369-8522-45f6-8241-3651623e47db';

1 Solution

Accepted Solutions
Anonymous
Not applicable

Again, I don't know if this would work in Qlik Sense.  But in our Qlikview deployment, we use mirror directories in our dev and prod environments.  So the location of our Include txt file scripts are in the same relative place.

So I used 2 different txt files with the SAME NAME for my include statement.

Except the content of the txt file in my dev environment has a different binary statement within it vs the txt file in my prod environment.

So both text files would be named BINARY.txt for instance but the script within the dev one would be

Binary 'lib://QSApps/45d5cbab-2850-4633-bce1-79bb29716fad';


And the script within the prod one would be

Binary 'lib://QSApps/02ff1369-8522-45f6-8241-3651623e47db';


View solution in original post

7 Replies
ogster1974
Partner - Master II
Partner - Master II

Ive not used it yet but something on my to do list is looking at the Qlik Deployment Framework.

QDF QlikView Getting Started Guide

It has a version for Sense and appears to touch on the deployment topic.

Regards

Andy

Anonymous
Not applicable

Can you use an Include file?

I work in Qlikview and it worked for me there.

Include statement references an txt file that has the binary statement.

rittermd
Master
Master
Author

What would the syntax be?

I tried this and it is not working:

If ComputerName()="QSS-1" Then $(Include=[Lib://Includes/DEV_Binary.txt]);

The text file contains the Binary statement

Anonymous
Not applicable

Again, I don't know if this would work in Qlik Sense.  But in our Qlikview deployment, we use mirror directories in our dev and prod environments.  So the location of our Include txt file scripts are in the same relative place.

So I used 2 different txt files with the SAME NAME for my include statement.

Except the content of the txt file in my dev environment has a different binary statement within it vs the txt file in my prod environment.

So both text files would be named BINARY.txt for instance but the script within the dev one would be

Binary 'lib://QSApps/45d5cbab-2850-4633-bce1-79bb29716fad';


And the script within the prod one would be

Binary 'lib://QSApps/02ff1369-8522-45f6-8241-3651623e47db';


marcus_sommer

This was a qlikview-case but maybe it could be adapted to qlik sense: Re: BINARY command to be constructed dynamically.

- Marcus

rittermd
Master
Master
Author

Brilliantly simple.  I always try to replicate the environments with the same names, etc. 

I tried to really over complicate this.  Your suggestion is perfect and works.

Thanks

Anonymous
Not applicable

That's a good one too Marcus!

I like this option too!

BINARY load with dynamic file name