Create a summary number as calculation aggregate sum expense minus aggregate sum reimbursements
Hello,
I am trying to create a beast mode calculation to show balance remaining after (sum of all expenditure)  (sum of all reimbursements).
here is my current calculation.
(case when `Expense Type` = 'Expenditure' then sum(`Account Balance`) else 0 end)

(case when `Expense Type` = 'Reimbursement' then sum(`Account Balance`) else 0 end)
The result I get is a sum of all (expenditure + reimbursements) rather than the intended (sum of all expenditures)  (sum of all reimbursements).
Thanks in advance for help.
Answers

You want to put your sum() around your case statement:
sum(case when `Expense Type` = 'Expenditure' then `Account Balance` else 0 end)

sum(case when `Expense Type` = 'Reimbursement' then `Account Balance` else 0 end)
2 
That actually worked. Thanks.
1
Categories
 7.6K All Categories
 Connect
 917 Connectors
 241 Workbench
 472 Transform
 1.8K Magic ETL
 60 SQL DataFlows
 445 Datasets
 30 Visualize
 196 Beast Mode
 2K Charting
 7 Variables
 1 Automate
 348 APIs & Domo Developer
 82 Apps
 Workflows
 14 Predict
 3 Jupyter Workspaces
 11 R & Python Tiles
 241 Distribute
 59 Domo Everywhere
 241 Scheduled Reports
 14 Manage
 35 Governance & Security
 19 Product Ideas
 1.1K Ideas Exchange
 Community Forums
 15 Getting Started
 1 Community Member Introductions
 49 Community News
 18 Event Recordings
 579 日本支部