Friday, September 14, 2018

Formula in a transaction saved search to get all accounts with account type sales but the contribution margin is 'blank' or 'null'.

Question/Problem:
 
Formula to get all accounts with account type sales but the contribution margin is 'blank' or 'null'.

Answer/Solution:
 
Create a Transaction Search with the following setting:

Criteria:
Filter Description
Type is any of Item Fulfillment, Sales Invoice, Item Receipt
Formula (Text) is not empty
Main Line is false
Dateis within 8/1/2010 and /8/31/2010
Account Type is any of sales, Cost of Goods Sold


Result:
Field Summary TypeFormulaLabel
Date
Period
Type
Created from: Sales TeamGroup
NameGroup
Account
Formula (Currency) SumDECODE ({accounttype), 'Sales', (amount),0)
Formula (Currency) Sum CASE WHEN {accounttype}='Sales' AND NVL2({createdfrom.contribution}, 0, 1)=1 then ({amount}*1) else 0 endSales * Contri%
Formula (Currency) Sum DECODE ({accounttype}, 'Cost of Goods Sold', {amount}, 0) Cost
Formula (Currency) Sum DECODE ({accounttype}, 'Cost of Goods Sold', {amount}, 0)*{createdfrom.contribution} Cost*Contri%
Formula (Currency) Sum {amount} GP
Formula (Currency) Sum {amount}*{createdfrom.contribution}Contrib*GP

No comments:

Post a Comment