COuld you post your app ?
if(Number = vResc, vSite,
if(Number <> vResc, if(not ISNULL(Lot),ApplyMap('PSMAP', Lot, 'Lot Without Map'))
,if (isNull(Lot), ApplyMap('MaskMapOne', Number, 'Multi-Site')) )) as MfgSite
Drop Table Stock_Data;
you are not suppose to use subroutine inside the expression.
you can also use function pick instead.
Thank you for your response.
I can post the app but there is little more detail on it than what I've posted and I can't post the full app because of sensitive data.
I have thought of your solution however How will the variable be assigned a new value?
The next number in the source table will always be different so the second condition in the if statement will always be met which is not the required outcome.
I need the variable vResc to change to with every new number for this method to work.
I want to see the data and be able to test my solution
I just look at this and make a changes to code but was not able to test it so may have some little problems -it was just to give you idea.
for variable you can choose function Peek or maybe you may need to create function for this case
its a little difficult to say now
but it can be easier if you will post as well expecting result with current app
You cannot CALL SubRoutines from inside a LOAD statement, you can only use functions (just like any QlikView function). SubRoutines don't return values, only functions do.
Redefine your code as a set of macro functions that return values and use them - without the CALL keyword - in a LOAD statement.
BTW CALL is a statement keyword. You cannot embed other statements in a LOAD...
To help you get started, see this example: Using Macro functions in Script
The non-standard function NextContractDate() is actually a user-defined macro function. See QV Desktop->Tools->Edit Module...