Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Sum columns base on column headers/values

Kshitij14
5 - Atom

In the below data, we need to select columns with the same "Type" (i.e Type1, Type2 ) and sum them. There could be any number of columns under each header "Type", also one "Type" will be in adjacent rows only.


The output should have sum of all columns where there is "Type1" in row2

 

 

Input:

F1F2F3F4F5F6F7F8F9F10F11
 Type1Type1Type1Type1Type1Type1Type2Type2Type2Type2
####Sec_1Sec_2Sec_3Sec_4Sec_5Sec_NSec_8Sec_2Sec_3Sec_20
Account_1$3.00$3.00$4.00$3.00$4.00$1.00$4.00$0.00$4.00$2.00
Account_2$2.00$1.00$3.00$4.00$0.00$2.00$4.00$0.00$0.00$5.00
Account_3$3.00$0.00$3.00$2.00$4.00$0.00$1.00$5.00$0.00$5.00
Account_4$1.00$5.00$5.00$0.00$0.00$4.00$4.00$3.00$1.00$5.00
Account_5$5.00$2.00$2.00$2.00$1.00$0.00$2.00$5.00$3.00$3.00
Account_N$0.00$5.00$1.00$2.00$2.00$3.00$0.00$5.00$4.00$2.00

 

 

Expected Output:

F1F2F3F4F5F6F7F8F9F10F11F12F13
 Type1Type1Type1Type1Type1Type1 Type2Type2Type2Type2 
####Sec_1Sec_2Sec_3Sec_4Sec_5Sec_NSum_Type1Sec_8Sec_2Sec_3Sec_20Sum_Type2
Account_1$3.00$3.00$4.00$3.00$4.00$1.00$18.00$4.00$0.00$4.00$2.00$10.00
Account_2$2.00$1.00$3.00$4.00$0.00$2.00$12.00$4.00$0.00$0.00$5.00$9.00
Account_3$3.00$0.00$3.00$2.00$4.00$0.00$12.00$1.00$5.00$0.00$5.00$11.00
Account_4$1.00$5.00$5.00$0.00$0.00$4.00$15.00$4.00$3.00$1.00$5.00$13.00
Account_5$5.00$2.00$2.00$2.00$1.00$0.00$12.00$2.00$5.00$3.00$3.00$13.00
Account_N$0.00$5.00$1.00$2.00$2.00$3.00$13.00$0.00$5.00$4.00$2.00$11.00

 

please assist.

3 REPLIES 3
FrederikE
13 - Pulsar

This is how you could approach it, you would still need to configure the WF to write the Field Names differently if you want to have it in the exakt same structure, but that should not be too complicated (but some work). 

FrederikE_0-1656095246022.png

FrederikE_1-1656095256369.png

 

Kshitij14
5 - Atom

Thanks a lot, it worked!!!!

I used Find and Replace tool instead of the last Union keeping F1 as key.

 

 

oly
Alteryx Alumni (Retired)

@Kshitij14 , did the column rename/sorting for you. Not very pretty but should work!

 

Labels