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: 
Not applicable

Calling a subroutine from the mainscript

Dear all,

I want to get familiar with subroutines and am therefore playing around with.

I therefore just wrapped a simple inline load statement in a sub and placed in the tab "subroutines"

SUB load()

  LOAD * INLINE [
  TEST1
  1
  2
  3
  ]
;

END SUB

No I try to call this subroutine in my main tab using the following code

CALL load()

But this gives me an error. Any thoughts on what Im doing wrong?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

order of your Tabs is wrong

Sub must be defined before it is called

Change order of your first and second tab

View solution in original post

4 Replies
jpenuliar
Partner - Specialist III
Partner - Specialist III

Hi Mar,

get rid of "()"

SUB load

Regards,

JP

Not applicable
Author

Hi Jonathan,

I tried you're suggestion (see below) but this still doesn't work... Am I overlooking a typo?

#First tab

CALL load()

#Second tab

SUB load

LOAD * INLINE [
Employee_ID, Customer_id, Order_id, Order_total
1, 11, 6, 12
2, 12, 7, 14
3, 13, 8, 176
4, 14, 9, 12
5, 15, 10, 8
]
;

END SUB

Anonymous
Not applicable
Author

order of your Tabs is wrong

Sub must be defined before it is called

Change order of your first and second tab

tamilarasu
Champion
Champion

Hi Marc,


Try like below,

#Firsttab

SUB load

LOAD * INLINE [
Employee_ID, Customer_id, Order_id, Order_total
1, 11, 6, 12
2, 12, 7, 14
3, 13, 8, 176
4, 14, 9, 12
5, 15, 10, 8
]
;

END SUB


#Secondtab

CALL load;


It is important that the call command should comes after the sub routines.