Skip to content


Use a sql lookup in a calculated field

Adrian Cooke asked 6 years ago
This question was asked in 2014 and I wonder whether there is a solution. I am importing from a file of PO receipts where I have a quantity field. This quantity field will always be in the base unit of measure but the PO could be another UofM. I want to be able to retrieve the Quantity In BaseUofM from the PO and convert the interface quantity into the correct unit. I can’t figure it out.
The previous question was – can I use a MSSQL lookup in a calculation
Patrick Roth Staff answered 6 years ago
No- MS SQL Lookup fields aren’t addressable in calculations (don’t know why, just aren’t).
to do this, you would have to either:
1. use vb/c# scripting to make your own sql connection to the data and run the query yourself.  And of course then you can do whatever you want with the results.
2. perhaps convert your map to a multi-data source map. then you would write a SQL query to pull the extra info that you need and join it to the source query from the file.
Adrian Cooke replied 6 years ago

Thanks Patrick, I’ll try the second option

If you would like to submit an answer or comment, please sign in to the eOne portal.