Syntax Error in Beast mode calculation
CASE
WHEN Sort: Month Number
= 1 THEN NULL
ELSE
(
(SUM(All Cases
) - LAG(SUM(All Cases
), 1) OVER (ORDER BY Sort: Month Number
)) /
LAG(SUM(All Cases
), 1) OVER (ORDER BY Sort: Month Number
)
)
END
I'm not able to figure out what is the syntax error over here. Can anyone please help?
Best Answer
-
Colemen's answer will give an empty string instead of a NULL. If you want a NULL, then you could flip your CASE statement. Everything that is not "not 1" will be NULL:
CASE
WHENSort: Month Number
!= 1 THEN
(
(SUM(All Cases
) - LAG(SUM(All Cases
), 1) OVER (ORDER BYSort: Month Number
)) /
LAG(SUM(All Cases
), 1) OVER (ORDER BYSort: Month Number
)
)
ENDPlease 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
2
Answers
-
You can't do WHEN
Sort: Month Number
= 1 THEN NULLYou could do WHEN
Sort: Month Number
= 1 THEN ''If I solved your problem, please select "yes" above
0 -
Colemen's answer will give an empty string instead of a NULL. If you want a NULL, then you could flip your CASE statement. Everything that is not "not 1" will be NULL:
CASE
WHENSort: Month Number
!= 1 THEN
(
(SUM(All Cases
) - LAG(SUM(All Cases
), 1) OVER (ORDER BYSort: Month Number
)) /
LAG(SUM(All Cases
), 1) OVER (ORDER BYSort: Month Number
)
)
ENDPlease 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
2
Categories
- All Categories
- 1.5K Product Ideas
- 1.5K Ideas Exchange
- 1.4K Connect
- 1.1K Connectors
- 278 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.7K Transform
- 89 SQL DataFlows
- 561 Datasets
- 2K Magic ETL
- 3.3K Visualize
- 2.3K Charting
- 576 Beast Mode
- 13 App Studio
- 28 Variables
- 584 Automate
- 142 Apps
- 415 APIs & Domo Developer
- 26 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 357 Distribute
- 96 Domo Everywhere
- 259 Scheduled Reports
- 2 Software Integrations
- 92 Manage
- 89 Governance & Security
- 9 Product Release Questions
- Community Forums
- 42 Getting Started
- 28 Community Member Introductions
- 89 Community Announcements
- 4.8K Archive