Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
hanna_choi
Partner - Creator
Partner - Creator

Why is the include variable executed?

Dear All

The include variable is located behind the exit clause.

This script is not interrupted in the exit clause.

Why is the include variable executed?

 

*********** Script  new *****

vServername = ComputerName() ;
trace $(vServername);
if '$(vServername)' = 'QlikDev' then 
trace '------1';
else
trace '------2';
end if
 
exit script;
 
vTargetPath_qvs = 'lib://File_Folder ;
$(Must_Include=[$(vTargetPath_qvs)/AUTH/Authorization.qvs]);
 
exit script;

 

*************** Script end

 

Qlik Sense Version : Nov 2023 patch 7

 

Best Regard

Hanna.choi

Labels (2)
1 Solution

Accepted Solutions
hanna_choi
Partner - Creator
Partner - Creator
Author

Hello @marcus 

 

Do you think that is bug?

 

Best Regard

Hanna.choi

View solution in original post

7 Replies
vuan
Partner - Contributor II
Partner - Contributor II

Hi Hanna,

if you already reload the script without "exit script" the variable after exit script will still remain in your application.

If you want to remove the variable you have to do it manually.

Kind regards

hanna_choi
Partner - Creator
Partner - Creator
Author

Hello @vuan 

Thank you for your reply.
Does include syntax mean it runs every time because it's a variable?

Are the variables executed unconditionally regardless of the exit clause?

Best Regard

Hanna.choi

vuan
Partner - Contributor II
Partner - Contributor II

Hi,

did you get an error like this one 

vuan_0-1711613867169.png

or is your issue that you don't want to have the variable vTargetPath_qvs 

KR

marcus_sommer

It's a behaviour which exists already in quite old QlikView releases and I assume it is there since implementing this feature. I'm not sure if it's really a bug which nobody noticed because the first documented usage was only include and not must_include and it don't happens to include.

I could imagine that if it would be a classical bug that fixing it shouldn't be very expensive - even if the priority for this case isn't very high. Therefore I think it's more an accepted side-effect to the way how the script is parsed and transferred to the engine which may much more sophisticated to solve.

The practically solution is therefore to comment the must_include. Not yet tried but probably possible might be to wrap the must_include within another include or a sub-routine or to build the statement on-the-fly ...

hanna_choi
Partner - Creator
Partner - Creator
Author

Hi @vuan 

I am curious Why the script is not stop at the exit script.
I don't understand why the error is happen at the"must_include" sentence.
"must_include" sentence is located after "exit script" .

 

Best regard

hanna.choi

hanna_choi
Partner - Creator
Partner - Creator
Author

Hello @marcus 

 

Do you think that is bug?

 

Best Regard

Hanna.choi

marcus_sommer

Like mentioned I'm not sure how to claim this behaviour. Thinkable would be for example that the exit script; statement is newer as must_include and is therefore during the run-time later evaluated or there were other intended scenarios to give it a higher priority (never checked but it would be a valide use.case), like: closing connections and cleaning the script after a script-error happens or maybe triggering further tasks to avoid any erroneous data or an instable system.