Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

I cannot call Sub routine from the Module.

Here is the script in the module.

--------------------------------------------------------------------------------------

function NextContractDate(ContractLength,ContractStart)

  f = 1

  do while f

  NextDate = DateAdd("m",ContractLength, ContractStart)

  if NextDate < date() then

  ContractStart = NextDate

  f = 1

  else

  f = 0

  end if 

  loop

  NextContractDate = NextDate * 1

end function

sub C

  msgbox NextContractDate(9, 40909)

end sub

function TestMe(a,b)

  TestMe = a + b

end function


--------------------------------------------------------------------------------------

Here is the script in the Qlikview document.

Call C



I don't know the reason why I am unable to call sub C from the script. Could you please figure out this issue?


Thank you very much indeed.

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You cannot call Module Subs from script. The script Call statement calls script subs, not module subs.

You can use Module Functions in script like:

LOAD NextContractDate(ContractLength,ContractStart) as NextContract Date

...FROM xxx;

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

3 Replies
Not applicable
Author

The error screen below was populated.

20-01-2017 10-44-45 AM.png

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You cannot call Module Subs from script. The script Call statement calls script subs, not module subs.

You can use Module Functions in script like:

LOAD NextContractDate(ContractLength,ContractStart) as NextContract Date

...FROM xxx;

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Not applicable
Author

oh. It's clear answer Rob.

Thank you for your answering.