MAX or SUM With Group BY ID

Reply
Highlighted
Visitor

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!

 

IDcolumn Acolumn B - max aggregate
1101
1111
2101
2111
3100
3100

Accepted Solutions
Red Belt
Red Belt

Re: MAX or SUM With Group BY ID

What you want is an analytic function that evaluates the max of the ID window and adds a column with that value.

See: https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/SQLReferenceManual/Functions/Analytic/MAXAn...

 

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 thumbs up in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"

All Replies
Red Belt
Red Belt

Re: MAX or SUM With Group BY ID

What you want is an analytic function that evaluates the max of the ID window and adds a column with that value.

See: https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/SQLReferenceManual/Functions/Analytic/MAXAn...

 

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 thumbs up in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
Visitor

Re: MAX or SUM With Group BY ID

@AS

Thanks for providing this information. 
You are correct, I just got off the phone with DOMO support and they said the same thing Smiley Sad

For now I'll have to use the dataflow.

Best.

White Belt

Re: MAX or SUM With Group BY ID

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

Visitor

Re: MAX or SUM With Group BY ID

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.

White Belt

Re: MAX or SUM With Group BY ID

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.

Announcements
September release notes Check out the details of our latest product release. Click here!