Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
i want to add this InvoiceQty and QtyOrdered by using apply map function
so i tried here
InvoiceQty:
Mapping LOAD ItemNumber,
InvoiceQty
Resident Invoice;
test1:
LOAD ItemNumber,
ApplyMap('InvoiceQty',QtyOrdered) as newqty
Resident Orders;
but the result is it only showing QtyOrdered data.
what am i doing wrong any suggestions?
Hi
What I see is you have multiple quantities for one ItemID.
By default applymap will take first value.
Have a look at below post for further clarification
http://community.qlik.com/message/534391#534391
Regards
ASHFAQ
Hope this will help you:
Thanks,
AS
Perhaps, like this:
LOAD ItemNumber,
ApplyMap('InvoiceQty', ItemNumber) as newqty
Resident Orders;
sorry amit using personal edition can tell whats wrong with the above code
thanks
Use ItemNumber instead of QtyOrdered in ApplyMap function..
Arul,
'ItemNumber' should be here instead of 'QtyOrdered' here in below script:
ApplyMap('InvoiceQty',QtyOrdered) as newqty
Thanks,
AS
To understand the concept please see below:
Script:
Purchase:
LOAD * Inline [
PurchaseID,Product,PurchasePrice,Quantity,PurchaseDate
P9, Product1, 8, 20, 15/10/2010
P11, Product1, 7, 10, 09/10/2010
P12, Product1, 9, 20, 01/10/2010
];
Temp:
Mapping LOAD
Product,PurchasePrice
Resident Purchase;
DROP Table Purchase;
Sales:
LOAD ApplyMap('Temp', Product ) as PurchasePrice,* Inline [
SalesID,Product,SalesPrice,Quantity,SalesDate
S1, Product1, 10, 10, 10/10/2010
];
Output:
Thanks,
AS
Use ItemNumber which is the Primary Key between 2 Tables:
Change your Code. See below:
InvoiceQty:
Mapping LOAD ItemNumber,
InvoiceQty
Resident Invoice;
test1:
LOAD ItemNumber,
ApplyMap('InvoiceQty',ItemNumber) as newqty
Resident Orders;
Regards
Av7eN
like this
ApplyMap('InvoiceQty',ItemNumber) as newqty
but it giving same result
Post your sample application to have a look.
Or try by changing your code like this
InvoiceMAP:
Mapping LOAD ItemNumber,
InvoiceQty
Resident Invoice;
test1:
LOAD ItemNumber,
ApplyMap('InvoiceMAP',ItemNumber) as newqty
Resident Orders;
Regards
ASHFAQ