Using FIXED () and Variable?

I'd like to create a BeastMode 'MTD %
' that can:
- Calculate the % of each GL account based of Total Sales
- Can be dynamically filtered by Month and Year variables
Here's my MTD %
Beast Mode:
SUM(`Amount`)/ (SUM(CASE WHEN `Class 3` = 'Sales' THEN `Amount` ELSE 0 END) FIXED ())
And my MTD
Beast Mode:
SUM(CASE
WHEN Fiscal Year
= Year Selector
AND Month Selector
= Month Name
THEN (Amount
*-1)
ELSE 0
END)
I just need to incorporate the MTD
in the MTD %
but it didn't work
Answers
-
How about
CASE
WHEN `Fiscal Year` = `Year Selector`
AND `Month Selector` = `Month Name`
THEN
SUM(`Amount`)
/
SUM(CASE WHEN `Class 3` = 'Sales' THEN `Amount` ELSE 0 END)
END** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
I tried, and I got this error
0 -
I didn't realize this was on a pivot table. Yes, the calculations must be full aggregated with the case logic contained in the aggregate. I don't have a sample dataset to test with. How about this?
MTD:SUM(
CASE
WHEN `Fiscal Year` = `Year Selector`
AND `Month Selector` = `Month Name`
AND `Class 3` = 'Sales'
THEN `Amount`
ELSE 0
END
)MTD %:
CASE
WHEN SUM(
CASE
WHEN `Fiscal Year` = `Year Selector`
AND `Month Selector` = `Month Name`
AND `Class 3` = 'Sales'
THEN `Amount`
ELSE 0
END
) = 0 THEN NULL
ELSE
SUM(
CASE
WHEN `Fiscal Year` = `Year Selector`
AND `Month Selector` = `Month Name`
THEN `Amount`
ELSE 0
END
)
/
SUM(
CASE
WHEN `Fiscal Year` = `Year Selector`
AND `Month Selector` = `Month Name`
AND `Class 3` = 'Sales'
THEN `Amount`
ELSE 0
END
)
END** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **0 -
Thank you for the response, yes I can provide a sample dataset with random numbers:
For my Pivot Table, I just dragged Class 1, 2, 3 into Rows, and MTD, MTD % Beast Modes into values
I tried the new MTD Beastmode above, I was only able to returned the Sales Amount and not other GL Account Amount, hence the MTD % won't work because it's not gonna be able to calculate the % of Sales for other.0
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 310 Workbench
- 7 Cloud Amplifier
- 9 Federated
- 3K Transform
- 114 SQL DataFlows
- 654 Datasets
- 2.2K Magic ETL
- 4K Visualize
- 2.5K Charting
- 796 Beast Mode
- 78 App Studio
- 44 Variables
- 757 Automate
- 188 Apps
- 480 APIs & Domo Developer
- 72 Workflows
- 17 DomoAI
- 40 Predict
- 17 Jupyter Workspaces
- 23 R & Python Tiles
- 408 Distribute
- 119 Domo Everywhere
- 279 Scheduled Reports
- 10 Software Integrations
- 141 Manage
- 137 Governance & Security
- 8 Domo Community Gallery
- 47 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 114 Community Announcements
- 4.8K Archive