Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Summing groups of rows by a common row value

ijurgensen
7 - Meteor

Hey All! New to Alteryx, and SO THANKFUL for this board for all of the wonderful solutions people post. 

 

GroupABCNew
1643324896(A+B)
2753951654(B+C)
3789516713(A+C)

 

I have a group of data wherein there's one column that defines the row as part of a single group of product. I then have columns with various attributes that I need to sum, but I need to sum different attributes specific to the product (example "New" column). I'd need all of the rows with "1" in the group column to add the "A" and "B" values in the new column, and all rows with "2" in the group column to add the "B" and "C" values in the same column, etc. 

 

What tool is best suited for this? 

 

Thank you!

5 REPLIES 5
morr-co
10 - Fireball

You could accomplish this with the formula tool using an IF statement. For example:

 

IF [Group] = 1

THEN [A] + [B]

ELSEIF [Group] = 2

THEN [B] + [C]

ELSEIF [Group] = 3

THEN [A] + [C]

ELSE Null()

ENDIF

vizAlter
12 - Quasar

Hi @ijurgensen — A "Formula" tool could be your friend:

IF [Group] = 1 THEN 
 [A]+[B] 
ELSEIF [Group] = 2 THEN 
 [B]+[C] 
ELSEIF [Group] = 3 THEN 
 [A]+[C] 
ELSE 
 Null() 
ENDIF

vizAlter_0-1601671233892.png

 

ijurgensen
7 - Meteor
Thank you!!
vizAlter
12 - Quasar

@ijurgensen — If this solves your issue please mark the answer "Solved" or "Solved" with a Like, if not let me know!

This will help other users find the same answer/resolution.  Thank you!

vizAlter
12 - Quasar

@ijurgensen — Thank you!

Labels