Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

pass parameter from load script to macro function

hi
i am trying to pass parameters from scrip (inside load statment) to macro function and i can't get the return parameter.
the parameters are array like '1,2,3,4,' and '100,0,20,0,' and '10'
my load scrip:
Result:
Load
key,
Get_num_in_array(MrpKeyArray,QtyDemandArray,QtySuplly) AS Demand_Supply_Key
Resident mrp ;
my function:

function Get_num_in_array(MrpKeyArray,QtyDemandArray,QtySuplly)
a=split(QtyDemandArray,",")
b=QtySuplly
c=split(MrpKeyArray,",")

For x=0 to UBound(a)-1
if QtySuplly => a(x) then
QtySuplly = QtySuplly - a(x)
ResultDemandQty = ResultDemandQty & a(x)  & ","
resultDemandKey = resultDemandKey & c(x)  & ","
else
ResultDemandQty =ResultDemandQty & QtySuplly  & ","
resultDemandKey = resultDemandKey & c(x) & ","
end if
next
Get_num_in_array = resultDemandKey & ResultDemandQty
End function


plaese help me.

Thanks in advance

1 Reply
fosuzuki
Partner - Specialist III
Partner - Specialist III

Hi,

It seems to be working for me.

Check the attached qvw.

Can you send a sample qvw?

Fernando