Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have the following section in my load script:
tProductTemp:
LOAD
ID as Comp_ID,
Name as Product,
"Descr EN",
StockValue,
Picture,
ParentComp,
"ParentComp CatalogTitle EN",
AdditionalParents,
"Used in B.O.M.",
"Custom",
ObsoleteSales,
ObsoletePurch,
ObsoletePurchSince,
ObsoleteStartDate,
ObsoleteStyleAbbr,
ObsoleteStyleDescr,
Deleted,
DeletedSince,
Minstock,
MaxStock,
CreationBy_User_ID,
FreeStock,
"Product Manager",
"Category Manager",
"DelStat Count",
"DelStat DelStDevMin",
"DelStat DelStDevMax",
"DelStat DelStDevAvg",
Brand,
"Brand Active I/V",
Seasonal,
FirstSupplDelNoteDate
FROM [lib://QVD/...]
(qvd) WHERE StockValue = 1;
LEFT JOIN
LOAD
Name as Product,
CostOfGood,
NewProduct
FROM [lib://QVD/...]
(qvd);
LEFT JOIN
LOAD *;
SQL SELECT
"Comp_ID",
min(LogDate) as EntryDate
FROM ... WHERE StoreLocation_ID = 49434 AND Qty > 0
GROUP BY Comp_ID;
tProduct:
LOAD
*,
(Minstock + 1) as Test
Resident tProductTemp;
drop Table tProductTemp;
If I use only the part above "tProduct:" all works well.
But when I add the last 7 or so lines (starting with "tProduct"), I get the error "Minstock not found". What am I doing wrong?
(What I actually want to do, is add a calculated field based on FirstSupplDelNoteDate and EntryDate).
The error message looks is this:
The following error occurred:
Field 'Minstock' not found
The error occurred here:
tProduct:
LOAD
*,
Minstock + 1 as Test
Resident tProductTemp
Looks like you have Qualify in your load script, and your field name is actually tProductTemp.Minstock (tablename.fieldname). So you'll need use this fully qualified name tProductTemp.Minstock in your reference.
"If I use only the part above "tProduct:" all works well."
Would you mind double checking using Data Model Viewer if you have a table "tProductTemp" with a field "Minstock"?
Remember, case letter matters.
Or maybe you might attach the log file here
I used the autofill of the load editor to type the names of the table and the field, so I don't think that's the problem.
They also do show up in the Model viewer (when I comment out the last lines, after "tProduct"):
Output is this:
21:06:34
Output cleared.
21:06:59
---
21:06:59
Started loading data
21:06:59
---
21:06:59
Connecting to SQL-ERP VC_DATA
21:06:59
Connected
21:06:59
tPCStrat << Sheet1
21:06:59
Lines fetched: 462
21:06:59
tSales << sp_StatComp
21:06:59
Lines fetched: 4.797.199
21:06:59
tProductTemp << sp_CompDetailAll
21:06:59
Lines fetched: 61.371
21:06:59
Comp
21:06:59
(QVD (row-based) optimized)
21:06:59
Lines fetched: 75.793
21:06:59
CompStorelocationLog
21:06:59
Lines fetched: 34.685
21:06:59
---
21:06:59
The following error occurred:
21:06:59
Field 'Minstock' not found
Looks like you have Qualify in your load script, and your field name is actually tProductTemp.Minstock (tablename.fieldname). So you'll need use this fully qualified name tProductTemp.Minstock in your reference.
Fabulous, that's it!! Thank you very much!