Alteryx Designer Desktop Discussions

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

Sumif multiple columns

Felipe_Amancio
7 - Meteor

Hi masters,

 

I would like to create a total column base on the following "IF" logic:

 

IF Type='E' THEN sum(A1:A6) ELSE sum(B1:B6) ENDIF

 

AccountOrgTypeA1A2A3A4A5A6B1B2B3B4B5B6
003325011E13-18224531116-291621
220910018B23224-172633452207-18
220910011B3121116-29211329162113
001318013E291621132916132916211329
001318018B172683345223121116-45
003325011E45316211329-291616-29

 

The expected result should have a total column as following:

 

AccountOrgTypeTotal
003325011E101
220910018B125
220910011B113
001318013E124
001318018B87
003325011E127

 

Thanks for your help

6 REPLIES 6
Felipe_Ribeir0
16 - Nebula

Hi @Felipe_Amancio 

 

Here is one way of doing this.

 

Your first and last row of the expected output should be summed, right?

 

AccountOrgTypeTotal
003325011E101
220910018B125
220910011B113
001318013E124
001318018B87
003325011E127

Felipe_Ribeir0_0-1665188875714.png

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

Felipe_Ribeir0
16 - Nebula

Hi @Felipe_Amancio 

 

One way of doing this.

Felipe_Ribeir0_0-1665189156029.png

 

The first and last row of your example should be summarized, right?

 

AccountOrgTypeTotal
003325011E101
220910018B125
220910011B113
001318013E124
001318018B87
003325011E127

 

 

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

Felipe_Ribeir0
16 - Nebula

Hi @Felipe_Amancio 

 

One way of doing this:

Felipe_Ribeir0_0-1665189289386.png

 

Matthew
11 - Bolide

this should work

 

my solution has one less row than your desired output because the Account, Org, and Type are identical. you need something unique to differentiate these rows if you want them separate

Matthew_0-1665189289474.png

 

flying008
14 - Magnetar

Hi, @Felipe_Amancio 

 

Maybe you need this output: 

Formula of [Value] :

IF [Type]="E" && left([Name], 1)="A" THEN [Value] 
ELSEIF [Type]!="E" && left([Name], 1)!="A" THEN [Value] 
ELSE 0 ENDIF

 

录制_2022_10_08_09_36_32_315.gif

 

***********

If it can help you get want result, please mark it as a solution and give a like for more share.

danilang
19 - Altair
19 - Altair

Hi @Felipe_Amancio 

 

If the number of columns is constant over time, you can always just use a simple formula tool

 

if [Type] = "E" then
   [A1]+[A2]+[A3]+[A4]+[A5]+[A6]
else
   [B1]+[B2]+[B3]+[B4]+[B5]+[B6]
endif 

 

danilang_0-1665230662502.png

 

Dan

 

Labels