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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
kuba_michalik
Partner - Specialist
Partner - Specialist

Strange behavior of CALL when passing literal numeric parameters (bug?)

When passing numeric literal as a parameter into a subroutine, QlikView creates extraneous variables with name and value both equal to the parameter. After reloading this script:

SUB subroutine(numeric_parameter);

     TRACE $(numeric_parameter);

ENDSUB;

CALL subroutine(1234);

this is the variable overview:

var.png

Has anybody else encountered this? If by chance anyone from Qlik sees this - could it be a bug, or if it's working as intended, could you shed some light on why it works this way?

This is not particularly impactful, but I like to write my subroutines so that they clean up after themselves when done. It's kind of hard to do because of this behavior

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Yes, this is a known behaviour and discussed e.g. in

Literals as sub parameters become variables

Try passing your number in the call using single quotes or brackets.

CALL subroutine('1234'); 

CALL subroutine((1234)); 

View solution in original post

1 Reply
swuehl
MVP
MVP

Yes, this is a known behaviour and discussed e.g. in

Literals as sub parameters become variables

Try passing your number in the call using single quotes or brackets.

CALL subroutine('1234'); 

CALL subroutine((1234));