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

Multiple Field Formula

ebledsoe22
8 - Asteroid

Hello,

 

I am trying to use the Multiple Field Formula tool in order to add/subtract values in 3 rows together. I am working on an apportionment workflow where my first row is my gross unadjusted data and the two subsequent rows are adjustments that need to be added to the first row. How do I create my formula in the expression tool to get my desired result?

16 REPLIES 16
BS_THE_ANALYST
14 - Magnetar

Since you are effectively adding all the rows together, wouldn't the Summarize tool suffice here?

ShankerV
17 - Castor

Hi @ebledsoe22 

 

You ask is possible by Multi row formula tool.

However can you post sample input and output expected so relevant formula can be suggested to get the desired result.

FinnCharlton
13 - Pulsar

Hi @ebledsoe22,

It sounds to me like you need to use the multi-ROW formula tool instead of the multi-FIELD. You can reference rows above and below using this tool. If you need some further help please attach some sample data and I'll help you write the formula.

ebledsoe22
8 - Asteroid

Hi @BS_THE_ANALYST I only need to apply the formula to 3 out 14 rows, not the entire data set.

FinnCharlton
13 - Pulsar

You could think about using the sample tool to take only the first 3 rows, then either use a multi-row formula or a summarize tool like @BS_THE_ANALYST has suggested. You might also be able to CrossTab your data to turn the rows to columns, and then use a normal formula tool. Again some sample data would help.

ebledsoe22
8 - Asteroid

Hi @ShankerV ad @FinnCharlton, I have 14 rows, but almost 60 columns due to this being a state apportionment project. Across the top are my states, and then my rows are labeled according to the different factors. I need this formula applied to all of the state columns, but only on 3 rows. Row 1 is the base inventory number, wile rows 2 and 3 are adjustments. I want to add the adjustments to the gross value for each state.

BS_THE_ANALYST
14 - Magnetar

@ebledsoe22 okay, we can add a record ID to the data. We can then filter out the records you want to select using the Filter tool. We can then apply the Summarize tool. See attached mock data ..

BS_THE_ANALYST_0-1673965504107.pngBS_THE_ANALYST_1-1673965508730.png

 

 

BS_THE_ANALYST
14 - Magnetar

Alternatively, you can use the Select Records tool which gives more intuitive flexibility to select the records you want to sum together. See attached

BS_THE_ANALYST_2-1673965634106.png

 

ShankerV
17 - Castor

Hi @ebledsoe22 

 

As you want to apply the sum for all 60 columns, multi field formula can't help.

You need to filter all the first 3 rows.

Do the Cross tab tool to do in all on row.

Then apply the multi row formula and then Transpose back.

 

Join to the original dataset.

 

Many thanks

Shanker V

Labels