we are trying to build a report to get me total qt...
# suiteql
s
we are trying to build a report to get me total qty sold and total revune this is working however with assembly and kits we want to sum the total of the parent /memeber item
Copy code
SELECT TOP 100
    Item.fullname AS member_item_name,
    SUM(Transaction.foreigntotal) AS total_foreigntotal,
    SUM(Transactionline.quantity) AS total_quantity,
    Item.itemtype
FROM
    Transaction
JOIN
    Transactionline ON Transaction.id = Transactionline.transaction
JOIN
    Item  ON Transactionline.item = Item.id
 
  
WHERE
    (Transaction.Type = 'CashSale' OR Transaction.Type = 'SalesOrd')
    AND Transaction.TranDate BETWEEN TO_DATE('1/2/2023', 'MM/DD/YYYY') AND TO_DATE('8/24/2023', 'MM/DD/YYYY')
    AND Transactionline.location = '5'
    AND Transactionline.accountinglinetype = 'COGS'
GROUP BY
    Item.fullname, Item.itemtype
ORDER BY
    total_foreigntotal DESC