Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to make the in "Order line"script function "Applymap" picked up [vnt.svoris] from "MAP001", because now write: Field vnt.svoris not found "public".erpoorli
//--------------------item------------------------------
[produktai]:
LOAD ID as [item.ID],
Name as [produkto.pav],
Code as [nv.kodas]
;
SQL SELECT *
FROM postgres."public".erpoitm
;
//----------------------MAP001----------------------------
MAP01:
Mapping LOAD ID,
if(len(TareWeight)>1, TareWeight, 1) as [vnt.svoris]
;
SQL SELECT *
FROM postgres."public".erpoitm
;
//----------------------------order line------------------------
[order.line]:
LOAD ID as [OLID],
OrderID as [order.ID],
ItemID as [item.ID],
Qty * APPLYMAP('MAP01', [vnt.svoris]) as [svoris],
LabelledQty as [at.kiekis]
;
SQL SELECT *
FROM postgres."public".erpoorli
I've found it works if TareWeigh the value is equal to the number (10) then everything works if there is a number (1,5) and then writes that can not find the field.
//----------------------MAP001----------------------------
MAP01:
Mapping LOAD ID,
TareWeight
;
SQL SELECT *
FROM postgres."public".erpoitm
;
//----------------------------order line------------------------
[order.line]:
LOAD ID as [OLID],
OrderID as [order.ID],
ItemID as [item.ID],
Qty as [kiekis.bl],
Qty * APPLYMAP('MAP01',if(len(TareWeight)>1,TareWeight,1)) as [vnt.svoris],
LabelledQty as [at.kiekis]
;
SQL SELECT *
FROM postgres."public".erpoorli
;
Hi,
When using the applymap, you provide the first field in the map and get the second ([vnt.svoris] in this case) as the result, so you need to use ID (or maybe OrderID not sure which from your data) instead
order.line]:
LOAD ID as [OLID],
OrderID as [order.ID],
ItemID as [item.ID],
Qty * APPLYMAP('MAP01', ID) as [svoris],
LabelledQty as [at.kiekis]
;
SQL SELECT *
FROM postgres."public".erpoorli
hope that helps
Joe
[vnt.svoris] should be replaced by the name of one field in postgres."public".erpoorli (ItemID ?)
The field names in the mapping table are irrelevant to the applymap function. The field name you need to use in the applymap function is a field from, in your case, the postgres.''public''.erpoorli table that contains ID values like those you load in the mapping table.
have a look at http://community.qlik.com/docs/DOC-5785 too for more info on applymap
I've found it works if TareWeigh the value is equal to the number (10) then everything works if there is a number (1,5) and then writes that can not find the field.
//----------------------MAP001----------------------------
MAP01:
Mapping LOAD ID,
TareWeight
;
SQL SELECT *
FROM postgres."public".erpoitm
;
//----------------------------order line------------------------
[order.line]:
LOAD ID as [OLID],
OrderID as [order.ID],
ItemID as [item.ID],
Qty as [kiekis.bl],
Qty * APPLYMAP('MAP01',if(len(TareWeight)>1,TareWeight,1)) as [vnt.svoris],
LabelledQty as [at.kiekis]
;
SQL SELECT *
FROM postgres."public".erpoorli
;