MAX or SUM With Group BY ID
I'm looking for a Beast Mode formula to create a MAX calculation by ID in my table.
My resulting column should look like column B below.
I already tried a formula with Distinct and MAX but while the formula was valid, my attempt still failed at producing desired results.
Keep in mind that in my scenario, column A is a calculated field already, don't know if that makes a difference.
Thanks!
ID | column A | column B - max aggregate |
11 | 0 | 1 |
11 | 1 | 1 |
21 | 0 | 1 |
21 | 1 | 1 |
31 | 0 | 0 |
31 | 0 | 0 |
Best Answer
-
What you want is an analytic function that evaluates the max of the ID window and adds a column with that value.
Domo has done some work on beast mode window functions but they aren't currently available, unfortunately. For now you'd have to bring that into a dataflow where you CAN perform window functions.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
Answers
-
What you want is an analytic function that evaluates the max of the ID window and adds a column with that value.
Domo has done some work on beast mode window functions but they aren't currently available, unfortunately. For now you'd have to bring that into a dataflow where you CAN perform window functions.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
I was very excited to see beast mode window functions in the #DP18 videos, so hopefully it is now enabled. But if not, the best way I’ve found for doing table calculations is a redshift sql DataFlow. The syntax for window functions is actually very readable and straightforward. Much simpler than trying to get head round the equivalent “table calculations” in Excel Tableau.
In your example it would be:
select *,
max(col) over (partition by id)
from table
0 -
thanks for suggesting sharing this work around.
I'll raise it's possibility to a colleague as I'm not familiar with a "redshift sql DataFlow"
Cheers.
1 -
No probs. It's a Beta feature, so you will need to ask DomoSupport to turn it on. It appears as a choice when you press "SQL" type connector.
0 -
@user02996 wrote:I'm looking for a Beast Mode formula to create a MAX calculation by ID in my table.
My resulting column should look like column B below.
I already tried a formula with Distinct and MAX but while the formula was valid, my attempt still failed at producing desired results.
Keep in mind that in my scenario, column A is a calculated field already, don't know if that makes a difference.
Thanks!
ID column A column B - max aggregate 11 0 1 11 1 1 21 0 1 21 1 1 31 0 0 31 0 0 ******************
You can accomplish this in a beastmode. To test do the following:
Create a Domo webform with the ID and Column A information listed above. Then in the analyzer create a table card and add a beastmode for Column B that looks like this:
max(`Column A`) over(partition by `ID`)
Your result should be a table that looks like :
ID Column A Column B
11 0 1 11 1 1 21 0 1 21 1 1 31 0 0 31 0 0 1 -
@Wills Are these officially supported functions now? They've been somewhat available in a hush-hush way for a bit, but without support, documentation, etc, I feel adoption isn't what it could be.
Aaron
MajorDomo @ Merit Medical
**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
The vertica beastmode functions used to be requested on/off item, meaning perpetual alpha/beta. These functions are now turned on for everyone by default but done so without documentation. So they are more like a secret menu item from in-n-out. This windowing function is not really supported due this lack of documentation and the fact that it may be replaced completly with a magic ETL dataflow "Rank and Windowing" tile as the real long term method for windowing calculations.
So enjoy that is is there but support will always direct you to the magic tile.
1 -
I don't understand the approach, if you make calculations in the ETL those values will be fixed, they can't evolve when filters are applied in the card
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive