ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Grouop by negative, positive and sum of value

wklcarolll
6 - Meteoroid

Hi All,

 

Does anyone know how to output the data from left to right?

I would like to group by Name, then having sub total of negative and postive number, as well as the sum. Thanks!

 

2023-08-03_17-35-52.png

5 REPLIES 5
DataNath
17 - Castor
17 - Castor

Hey @wklcarolll, not sure how you want to display the results exactly but this workflow gets you to the desired format in a single table. We basically:

 

1 - Use a filter to split negative/positive values and then sum each stream, grouped by Name.

2 - Do an overall sum for each name.

3 - Add a ' sum' tag to each name for the output of step 2.

4 - Re-union all of our streams and sort by name ascending (to get the ' sum' tag as the final row of each 'section' and then Sum_Number ascending to start with the negative values for each person).

 

Hope this helps!

caltang
17 - Castor
17 - Castor

@DataNath has an excellent answer @wklcarolll - try it!

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
wklcarolll
6 - Meteoroid

It works! Thanks @DataNath  and @caltang .

Further would like to ask if you happen to know how to highlight the row with SUM? Thanks!

caltang
17 - Castor
17 - Castor

You will need to use the Reporting tools to do that, then use a Render tool to export to Excel. The Table Tool allows you to highlight it into any colour of your liking.

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
caltang
17 - Castor
17 - Castor

@wklcarolll try it. I've enhanced @DataNath's work. Credit to him.

 

If it helps, kindly mark @DataNath's and this comment as accepted solutions so that it may help others & close this thread.

 

Thanks!

 

-Cal

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels
Top Solution Authors