Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to call an include file within a Sub Routine like below example, which doesn't work?
SUB plt.Global(_Cust)
LET _Cust = IF(LEN('$(_Cust)') = 0 , 'EXIT SCRIPT;', '$(Must_Include=c:\qlikview\customers\$(_Cust)\bin\global.qvs)');
END SUB
CALL plt.Global('MyCustomer');
Try:
Sub plt.Global(_Cust)
If Len($(_Cust)) = 0 THEN
Exit SCRIPT;
ELSE
$(Must_Include=c:\qlikview\customers\$(_Cust)\bin\global.qvs);
ENDIF
END Sub
CALL plt.Global('MyCustomer');
Try:
Sub plt.Global(_Cust)
If Len($(_Cust)) = 0 THEN
Exit SCRIPT;
ELSE
$(Must_Include=c:\qlikview\customers\$(_Cust)\bin\global.qvs);
ENDIF
END Sub
CALL plt.Global('MyCustomer');
Thanks, I will try tomorrow morning when I get back to it, thanks
Thanks,
The "Must" throws an error as the Variable is not defined within the Sub Routine, so removing the Must part in the include statement allows the routine to run, the other issue is that if the global.qvs file does not exist, it will also not throw an error, but at least it works somewhat.
So the below works perfect
Sub plt.Global(_Cust)
If Len('$(_Cust)') = 0 THEN
Exit SCRIPT;
ELSE
$(Include=c:\qlikview\customers\$(_Cust)\bin\global.qvs);
ENDIF
END Sub
CALL plt.Global('MyCustomer');