How to correctly add the Bad bedt attribut to the report data model query
SELECT
hp.PARTY_NAME AS "Customer_name",
rcta.TRX_DATE AS "TRANSACTION_Date",
rcta.TRX_NUMBER AS "TRANSACTION_NB",
fabuv.BU_NAME AS "Business_unit",
rcta.INTERFACE_HEADER_ATTRIBUTE1 AS "contract_number",
apsa.AMOUNT_DUE_ORIGINAL AS "Total",
apsa.AMOUNT_DUE_REMAINING AS "CURRENT",
apsa.DUE_DATE AS "Due_Date",
(SELECT ATTRIBUTE3
FROM RA_CUSTOMER_TRX_ALL
WHERE Customer_trx_id = rcta.Customer_trx_id
AND ROWNUM = 1) AS "Bad_Debt",
(SELECT okht.COGNOMEN
FROM OKC_K_HEADERS_TL okht, OKC_K_HEADERS_ALL_B okhab
WHERE okhab.id = okht.id
AND okhab.contract_number = rcta.INTERFACE_HEADER_ATTRIBUTE1
AND ROWNUM = 1) AS "contract_name"
Tagged:
0