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
- Product Ideas
- 2K Ideas Exchange
- Connect
- 1.3K Connectors
- 308 Workbench
- 7 Cloud Amplifier
- 10 Federated
- Transform
- 661 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 819 Beast Mode
- Visualize
- 2.6K Charting
- 85 App Studio
- 46 Variables
- Automate
- 193 Apps
- 483 APIs & Domo Developer
- 85 Workflows
- 23 Code Engine
- AI and Machine Learning
- 22 AI Chat
- 3 AI Projects and Models
- 18 Jupyter Workspaces
- Distribute
- 116 Domo Everywhere
- 282 Scheduled Reports
- 11 Software Integrations
- Manage
- 142 Governance & Security
- 9 Domo Community Gallery
- 49 Product Releases
- 13 Domo University
- Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 5K Archive