Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

marco_puccetti
Contributor

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
MVP
MVP

Re: Qliksense Functions

CALL after you defined the SUB routine in your script.

marco_puccetti
Contributor

Re: Qliksense Functions

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

marco_puccetti
Contributor

Re: Qliksense Functions

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

MVP
MVP

Re: Qliksense Functions

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
Contributor

Re: Qliksense Functions

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

Community Browser