Scenario: Client needs to list invoices that are associated the sales order in a single line within a transaction saved search also by summing up the quantity for specific item in the saved search.
Solution:
Solution
Navigate to Lists > Search > Saved Searches > New
Select Transaction as the search type
In Criteria tab:
FILTER
Mainline is false
Tax Line is false
Shipping Line is false
Type is any of Item Sales Order
In Results tab:
Standard:
Date: Maximum
Document Number: Group
Name: Maximum
Formula(Numeric): Maximum: NVL(SUM(CASE WHEN {item.id}= 4578 Then {quantityshiprecv} ELSE 0 END)/NULLIF(COUNT(DISTINCT({billingtransaction.internalid})),0),SUM(CASE WHEN{item.id}=4578 THEN {quantityshiprecv}ELSE 0 END))
Formula(Text): Maximum: NVL(SUM(Case When {item.id}=4578 Then {quantityshiprecv} Else 0 End)/NULLIF(COUNT(DISTINCT({billingtransaction.internalid})),0),SUM(Case When {item.id}=4578 Then {quantityshiprecv} Else 0 End))