Returning a Max Result in a column
Options
Steve Smith
Member
CASE
WHEN D's % of AOR
= MAX(D's % of AOR
) THEN 1
ELSE 0
END
Some how this is returning the total for the column. All values are returning a 1.
Tagged:
0
Comments
-
Try converting to a window function so that each row is compared to a single value instead of the aggregated value.
CASE WHEN `D's % of AOR` = MAX(`D's % of AOR`) OVER () THEN 1 ELSE 0 END
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
Used this exact code to return the max date, however, with this code all values are retuning 0.
0
Categories
- All Categories
- 1.5K Product Ideas
- 1.5K Ideas Exchange
- 1.4K Connect
- 1.1K Connectors
- 280 Workbench
- 4 Cloud Amplifier
- 4 Federated
- 2.7K Transform
- 90 SQL DataFlows
- 563 Datasets
- 2K Magic ETL
- 3.4K Visualize
- 2.3K Charting
- 592 Beast Mode
- 13 App Studio
- 28 Variables
- 588 Automate
- 143 Apps
- 417 APIs & Domo Developer
- 27 Workflows
- 1 DomoAI
- 28 Predict
- 12 Jupyter Workspaces
- 16 R & Python Tiles
- 361 Distribute
- 99 Domo Everywhere
- 260 Scheduled Reports
- 2 Software Integrations
- 94 Manage
- 91 Governance & Security
- 9 Product Releases
- Community Forums
- 37 Getting Started
- 28 Community Member Introductions
- 90 Community Announcements
- 4.8K Archive