Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
srihitha
Contributor III
Contributor III

variables scope

What are exceptions to the global scope of variables in qlik sense

Labels (3)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

parameters passed in a sub-routine exists only in the scope of that sub routine,

but you can pass those variable values  from within  a routine to another sub-routine

 

example:

sub traceMyName(vMyName)
let vNameIs = '$(vMyName)';      <<<---Any variables created using let / set will exist in your app
call anotherSub('$(vNameIs)')
end sub


sub anotherSub(Name)
Trace My Name is '$(Name)';
End Sub

Call traceMyName('Vinie');

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

3 Replies
micheledenardi
Specialist II
Specialist II

Can you explain better your request?

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
srihitha
Contributor III
Contributor III
Author

Are all variables in qlik sense global?

Are there any local variables..like if a variable is defined inside a subroutine..is it global or local?

I want to know all places where scope of variable is local 

vinieme12
Champion III
Champion III

parameters passed in a sub-routine exists only in the scope of that sub routine,

but you can pass those variable values  from within  a routine to another sub-routine

 

example:

sub traceMyName(vMyName)
let vNameIs = '$(vMyName)';      <<<---Any variables created using let / set will exist in your app
call anotherSub('$(vNameIs)')
end sub


sub anotherSub(Name)
Trace My Name is '$(Name)';
End Sub

Call traceMyName('Vinie');

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.