We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

SumIfs and condtional addition

davidlocke
7 - Meteor

I am replicating various pages of IRS Form 1120 in Alteryx for several entities.  I have already populated the individual data lines, but need to find a way to add the various subtotal and total lines on the form. Below is an example of where I am at presently:

1120 Pg 1 Line No1120 Pg 1 Line DescTRC TCC Combo10001100
1aGross Receipts or Sales30-100.010-781559441.4-841483424.7
1bReturns and Allowances30-105.0106166957.93238364717.5
1cBalance - Net Salesnull00
     
2Cost of Goods Sold40-110.01000
2Cost of Goods Sold40-120.010545886855.8477116716.3
2Cost of Goods Sold40-130.01011202069.645071500.26
2Cost of Goods Sold40-140.01000
2Cost of Goods Sold40-150.02038.70
2Cost of Goods Sold40-150.025-28592475281139.12
2Cost of Goods Sold40-150.06000
2Cost of Goods Sold40-150.10000
2Cost of Goods Sold40-150.105429.5544.25
2Cost of Goods Sold40-150.1802137809.66967662.61
2Cost of Goods Sold40-150.220276674.1826157.04
2Cost of Goods Sold40-150.340157650.72343236.63
2Cost of Goods Sold40-150.46000
2Cost of Goods Sold40-150.5001488178.3771143.72
2Cost of Goods Sold40-150.54535164.9832.83
2Cost of Goods Sold40-150.5807124074.850
2Cost of Goods Sold40-150.5851890203.632614223.2
2Cost of Goods Sold40-150.59091116.460
2Cost of Goods Sold40-150.595875354.250
2Cost of Goods Sold40-150.620201251.2139829.86
2Cost of Goods Sold40-150.625133757.2763900.28
2Cost of Goods Sold40-150.630267930.3636963.34
2Cost of Goods Sold40-150.635208151.381035343.96
2Cost of Goods Sold40-150.70046144.4803413.85
2Cost of Goods Sold40-150.705408316.40
2Cost of Goods Sold40-150.7102404279.280
2Cost of Goods Sold40-150.74000
2Cost of Goods Sold40-150.745094466.08
2Cost of Goods Sold40-150.750447391.18064.92
2Cost of Goods Sold40-150.755608989.97149742.72
2Cost of Goods Sold40-150.76000
2Cost of Goods Sold40-150.780823890.1287858.02
2Cost of Goods Sold40-150.82000
2Cost of Goods Sold40-150.9007375759.520
2Cost of Goods Sold40-160.010883629.17348264.87
2Cost of Goods Sold40-170.01038307.570
2Cost of Goods Sold40-190.01000
3Gross Profitnull00

 

I need to sum lines 1a and 1b to create a subtotal that should display on 1c.  Then I need to  add line 1c with the sum all of the instances of line 2.  While there are other lines that I need to add, this should be enough data to help me replicate.

 

I would expect the solution to look like this:

1120 Pg 1 Line No1120 Pg 1 Line DescTRC TCC Combo10001100
1aGross Receipts or Sales30-100.010-781559441.4-841483424.7
1bReturns and Allowances30-105.0106166957.93238364717.5
1cBalance - Net Salesnull-775392483.5-603118707.2
     
2Cost of Goods Sold40-110.01000
2Cost of Goods Sold40-120.010545886855.8477116716.3
2Cost of Goods Sold40-130.01011202069.645071500.26
2Cost of Goods Sold40-140.01000
2Cost of Goods Sold40-150.02038.70
2Cost of Goods Sold40-150.025-28592475281139.12
2Cost of Goods Sold40-150.06000
2Cost of Goods Sold40-150.10000
2Cost of Goods Sold40-150.105429.5544.25
2Cost of Goods Sold40-150.1802137809.66967662.61
2Cost of Goods Sold40-150.220276674.1826157.04
2Cost of Goods Sold40-150.340157650.72343236.63
2Cost of Goods Sold40-150.46000
2Cost of Goods Sold40-150.5001488178.3771143.72
2Cost of Goods Sold40-150.54535164.9832.83
2Cost of Goods Sold40-150.5807124074.850
2Cost of Goods Sold40-150.5851890203.632614223.2
2Cost of Goods Sold40-150.59091116.460
2Cost of Goods Sold40-150.595875354.250
2Cost of Goods Sold40-150.620201251.2139829.86
2Cost of Goods Sold40-150.625133757.2763900.28
2Cost of Goods Sold40-150.630267930.3636963.34
2Cost of Goods Sold40-150.635208151.381035343.96
2Cost of Goods Sold40-150.70046144.4803413.85
2Cost of Goods Sold40-150.705408316.40
2Cost of Goods Sold40-150.7102404279.280
2Cost of Goods Sold40-150.74000
2Cost of Goods Sold40-150.745094466.08
2Cost of Goods Sold40-150.750447391.18064.92
2Cost of Goods Sold40-150.755608989.97149742.72
2Cost of Goods Sold40-150.76000
2Cost of Goods Sold40-150.780823890.1287858.02
2Cost of Goods Sold40-150.82000
2Cost of Goods Sold40-150.9007375759.520
2Cost of Goods Sold40-160.010883629.17348264.87
2Cost of Goods Sold40-170.01038307.570
2Cost of Goods Sold40-190.01000
3Gross Profitnull-218971540-113759003.3
3 REPLIES 3
RobertOdera
13 - Pulsar

Hi, @davidlocke 

 

Try this.

Please mark as a solution + like, if this works for you.

 

RNO2_0-1591060380996.png

 

The output + workflow are attached.

Cheers!

davidlocke
7 - Meteor

What does the [_Current Field_] do?

RobertOdera
13 - Pulsar

Hi, @davidlocke 

 

In your use case, I'm using it to cast targeted fields as a Fixed Decimal type (number with two decimal places) from text, so that I can aggregate them in the Summarize Tool (if they streamed into the Summarize Tool as Text, the SUM option would not be available to me)

 

🙂Fixed Decimal is what I chose as the best match to the optics of your desired output.

RNO2_0-1591116680771.png

 

The [_Current Field_]  argument allows me to apply the treatment to both the fields concurrently and with economy.

Otherwise I could also have used a Formula Tool by creating two new fields:

 

new_field1 = ToNumber([1000]) and make type Fixed Decimal

new_field2 = ToNumber([1100]) and make type Fixed Decimal

 

I hope this is helpful.

Cheers!

 

 

 

 

 

Labels
Top Solution Authors