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: 
marco_puccetti
Partner - Creator
Partner - Creator

Qliksense Functions

Hello i need to use some functions within a qliksense application, but i've noticed that the code is executed without taking care of routine definitions, is it possible or not.

This is a simple definition used in the application:

Set bEsito = False;

call clearETLinLine(bEsito);

sub clearETLinLine(bEsito)

  DROP TABLE A;

  DROP TABLE B;

  DROP TABLE C;

  DROP TABLE D;

  DROP TABLE E;

  

  Set bEsito = True;

end Sub

Thanks

Marco

5 Replies
swuehl
MVP
MVP

CALL after you defined the SUB routine in your script.

marco_puccetti
Partner - Creator
Partner - Creator
Author

I've noticed that the routines are executed without calling them, in order of script definition.

marco_puccetti
Partner - Creator
Partner - Creator
Author

I explain better my question...if i declare functions before there call, i have noticed that the code is executed sequentially from the first step of the script to the end without taking care of the function definition.

Below the example of function declaration\use.

line 1   : sub pippo(param)

line 20: end sub

line 100: call pippo(param);

The code is executed from the first line to the 100 line without taking care of this. And if a will declare at contrary shall the code stop at the end of the function definitio or not?

Anybody knows how to solve this?

Thanks

Marco

swuehl
MVP
MVP

So you are saying that

SUB Test(Param)

TRACE PARAM: $(Param);

TRACE SUB EXECUTED;

ENDSUB

//CALL Test(10);

is the same as

SUB Test(Param)

TRACE PARAM: $(Param);

TRACE SUB EXECUTED;

ENDSUB

CALL Test(10);

That's not what I see, the first code is not outputting anything.

marco_puccetti
Partner - Creator
Partner - Creator
Author

I have checked better and noticed that the code is executed but if the function aren't call when the line meet sub the function is not executed so it's ok.

Thanks