Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Binary inside IF

Hello;

I'm trying reload a QVW file with the Binary sentence. But I need change the qvw file depending on the value of a variable.

I tried many things but I didn't success.

The script I have is soemthing like this:

IF vR=0 THEN

Binary [\\PATH\QLIKVIEW.qvw];

ELSE

Binary [\\PATH\QLIKVIEW2.qvw];

ENDIF

If I run this script I have this error message:

Unknown Sentence

Binary [\\PATH\QLIKVIEW.qvw]


If I run the script without the IF condition goes well.


I tried include the sentence in a text file and call it by: $(Must_Include=..\Scripts\Script1.txt);

This didn't go well.

I hope someone knows what I'm doing wrong. Is not valid writing poor English  🙂


Thanks,

Fernando


1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hello Fernando,

I think Binary Load must be the first sentence in the script, and only one is allowed in the script.

I can't think in a way to have 2 different binarys in the same script.

Regards,

Gabriel

View solution in original post

14 Replies
Anonymous
Not applicable
Author

Hello Fernando,

I think Binary Load must be the first sentence in the script, and only one is allowed in the script.

I can't think in a way to have 2 different binarys in the same script.

Regards,

Gabriel

swuehl
MVP
MVP

What if you - instead of setting vR to 0 or something else - define a variable with the qlikview file name to load?

Binary [\\PATH\$(vFile)];

prabhu0505
Specialist
Specialist

Are you passing the value for vR from publisher?

swuehl
MVP
MVP

You can also look into the solution suggested by Maxgro here:

Re: BINARY load with dynamic file name

This involves another QVW, so in server environment, you may need to first reload the first QVW with your vR passed to generate the include file, then reload the QVW with the include statement to execute the chosen binary.

tamilarasu
Champion
Champion

Hi Fernando,

As per my knowledge, the binary statement must be the first statement in the LOAD script. so you cannot use it by preceding any other statement. This is applicable for the hidden script.

Seems you are not using any hidden script in the application. My suggestion is create an another variable something like,

Variable Name -> vFileName

Definition -> =if(vR=0, 'File1','File2')

Then use the binary load as (should be very first statement)

Binary [\\Path\$(vFileName)];

Let me know.

Not applicable
Author

Thanks Gabriel

I didn't remember that the senetnce Binary in the script must be the first.

I did it with a variable.

Thank you very much,

Fernando

Not applicable
Author

Thanks swuehl

I did it with a variable.

Thank you very much,

Fernando

Not applicable
Author

Thanks Saravana

The problem was that the sentence Binary, in the script, must be the first.

I did it with a variable.

Thank you very much,

Fernando

Not applicable
Author

Thanks Tamil

I didn't remember that the sentence Binary in the script must be the first.

I did it with a variable as you told me.

Thank you very much,

Fernando