Alteryx Designer Desktop Discussions

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

Adding up values based on ID

RoxanneR
7 - Meteor

Hi 

I am struggling with this scenario

What I want to do in is: Add all of the values in the "SUM Value" column for each unique combination of General ID and ID.

The output should look like the "SUM values" column, where all the values for each unique General ID and ID would be added together. 

The columns Column 1, Column 2, Column 3 shouldn’t be summarized but I will also need them to be included in the output.

Column 1

Column 2

Column 4

General ID

ID

Value

SUM Value

Description

Country

City

10

101

0

 

Description

Country

City

10

101

20

20

Description

Country

City

12

102

30

 

Description

Country

City

12

102

30

60

 

I tried Summarize + Join but unsuccessfully because after JOIN I had this result -which isn't correct

Column 1

Column 2

Column 4

General ID

ID

Value

SUM Value

Description

Country

City

10

101

0

20

Description

Country

City

10

101

20

20

 

Second question would be how can I summarize the values in SUM Value column without loosing the first 3 columns?

4 REPLIES 4
CoG
13 - Pulsar

If the 2nd table in your problem description is wrong, how do you know which row to add the SUM Value to? Is it always the last row? or can it be any row as long as it is only one row (for given [General ID] and [ID])?

Raj
16 - Nebula

DO you want your output as

Column 1

Column 2

Column 4

General ID

ID

Value

SUM Value

Description

Country

City

10

101

0

20

Description

Country

City

10

101

20

20

Description

Country

City

12

102

30

30

Description

Country

City

12

102

30

60

or 

Column 1

Column 2

Column 4

General ID

ID

Value

SUM Value

Description

Country

City

10

101

0

20

Description

Country

City

10

101

20

20

Description

Country

City

12

102

30

60

Description

Country

City

12

102

30

60

CoG
13 - Pulsar

Here is a sample workflow that matches your stated desired output based on the last row of a given group:

_Screenshot.png

NoelCarson
6 - Meteoroid

I would have done the same. You will need to summarize based on the General ID and then use the Join tool to get the missing fields back.

Labels