`SELECT` `BUILTIN.DF( entity.topLevelParent ) AS ...
# suiteql
j
SELECT
BUILTIN.DF( entity.topLevelParent ) AS TopLevelParent,
BUILTIN.DF( Transaction.Employee ) AS Salesrep,
BUILTIN.DF( TransactionLine.Item ) AS Item,
SUM( TransactionLine.Quantity )*-1 AS Quantity,
CASE WHEN TO_CHAR ( transaction.tranDate, 'YYYY-MM' ) = '2022-10' THEN SUM( TransactionLine.Quantity )*-1 END
FROM
Transaction
LEFT OUTER JOIN Entity ON
( Entity.ID = Transaction.Entity )
LEFT OUTER JOIN TransactionLine ON
( TransactionLine.Transaction = Transaction.ID )
LEFT OUTER JOIN Item ON
( Item.ID = TransactionLine.Item )
WHERE
( Transaction.type IN ('CustInvc','CustCred','CashSale') AND item.custitem_tss_inventory_rank = '3' )
GROUP BY ROLLUP
( BUILTIN.DF( entity.topLevelParent ),
BUILTIN.DF( Transaction.Employee ),
BUILTIN.DF( TransactionLine.Item ) )
Any idea why im getting Search error occurred: Invalid or unsupported search
j
you have something in your SELECT that is not SUMMED and is not in your GROUP
your CASE should be inside your SUM, not the other way around
Copy code
SUM(CASE WHEN TO_CHAR(transaction.trandate, 'YYYY-MM') = '2022-10' THEN transactionline.quantity * -1 ELSE 0 END) AS summed_quantity_on_date
or something like that
is
ROLLUP
supported?
j
its working without the case
havent tried with the case