Я использую Informatica Designer, и в отображении я использую переопределение Lookup sql в Lookup Transformation, поэтому какие изменения необходимо внести в sql, чтобы он не выдавал ошибку при запуске отображения.
SELECT
PTO_COST,COST_PERCENT,ATO_NET,INTEGRATION
FROM
(
SELECT
INVOICE_NUM,INVOICE_ITEM,SALES_ORDER_NUM, SALES_ORDER_ITEM, NET_AMT,LIST_AMT,COST_AMT,PRODUCT_TYPE_CODE,F.INTEGRATION_ID AS INTEGRATION,
CASE WHEN P.PRODUCT_TYPE_CODE = 'ATO' THEN SUM(COST_AMT) OVER (PARTITION BY SALES_ORDER_NUM, SALES_ORDER_ITEM,INVOICE_NUM) ELSE 0 END AS PTO_COST,
CASE WHEN P.PRODUCT_TYPE_CODE = 'ATO' THEN (COST_AMT/SUM(COST_AMT) OVER (PARTITION BY SALES_ORDER_NUM, SALES_ORDER_ITEM,INVOICE_NUM)) ELSE 0 END AS COST_PERCENT,
CASE WHEN P.PRODUCT_TYPE_CODE = 'PTO' THEN SUM(NET_AMT) OVER (PARTITION BY SALES_ORDER_NUM, SALES_ORDER_ITEM,INVOICE_NUM,PRODUCT_TYPE_CODE) ELSE 0 END AS ATO_NET,
CASE WHEN P.PRODUCT_TYPE_CODE = 'PTO' THEN SUM(COST_AMT) OVER (PARTITION BY SALES_ORDER_NUM, SALES_ORDER_ITEM,INVOICE_NUM) ELSE 0 END AS ROLL_UP_COST
FROM EDW.W_SALES_INVOICE_LINE_FS F,
EDW.W_PRODUCT_D P
WHERE
F.PRODUCT_ID = P.INTEGRATION_ID
)