I have this query. How would i add another column ...
# suiteql
j
I have this query. How would i add another column to show the wave attached? The next and previous transaction table is confusing.
Copy code
SELECT
	BUILTIN.DF( Transaction.Entity ) AS Customer,
	Transaction.TranID,
	BUILTIN.DF( Transaction.Status ) AS Status_Description,
	BUILTIN.DF( transaction.employee) AS SalesRep,
	Transaction.ShipDate AS ScheduledShipDate,
	Transaction.ForeignTotal,
	Transaction.TotalCostEstimate,
	Transaction.EstGrossProfit,
	ROUND( ( Transaction.EstGrossProfitPercent * 100 ), 2 ) AS GPPct,
(
		SELECT DISTINCT
			SO.TranID,
		FROM
			NextTransactionLineLink AS NTLL
			INNER JOIN Transaction AS SO ON
				( SO.ID = NTLL.NextDoc )
		WHERE
			( NTLL.PreviousDoc = Transaction.ID )
			AND ( SO.Type = 'ItemShip' )
	) AS ItemFulfillment,
FROM
	Transaction	
WHERE
	( Transaction.Type = 'SalesOrd' )
	AND ( transaction.status = 'SalesOrd:B' )
	AND TO_CHAR(shipdate, 'mm') = TO_CHAR(sysdate, 'mm') AND TO_CHAR(shipdate, 'yyyy') = TO_CHAR(sysdate, 'yyyy')
	AND transaction.custbody_mm_do_not_wave_cb = 'F'
ORDER BY
	Transaction.EstGrossProfit DESC, Transaction.ForeignTotal;