community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

How to simplify a Multi_Row Formula instead of repeating it 5 times?

Comet

Need help.

 

My data sometimes has more than 1 row for an item.  B only occurs here and there.  But, it is always preceded by an A.   Everything else is just an A.  

 

When an A - B pair exists, I need A to be changed to reflect the product of [A] + [B].  This is the desired end-state.

 

I was able to setup a Multi-Row Formula tool.   But, that was when I was only dealing with 1 group.   Now, I have to scale it to 5 Groups.   I can do it, but only by threading 5 Multi-Row Formula Tools (1 for each category).  Is there a better way to implement this.

 

 

Item IDCostTypeGroup1Group2Group3Group4Group5
1001A100150100125133
1001B-25-7-18-14-15

 

9999A5456567889
       

 

The screenshot is from my actual data, so the groups (column headers) are a bit different.

Thanks! 

 

Screen Shot 2018-02-14 at 5.37.15 PM.png

 

Screen Shot 2018-02-14 at 5.38.03 PM.png

 

 

 

Alteryx Certified Partner

If only there was a combined multi-row and field tool...  You could:

  1. Transpose your data, selecting Item ID and CostType as key fields and your group fields as data fields
  2. Sort by Name, Item ID, and CostType
  3. Perform your multi-row calc
  4. Cross-Tab back to your original format

This doesn't save you that many tools with your current data structure but is more dynamic  if let's say you end up having 50 group columns.

 

Hope this helps.

Highlighted
Pulsar

If each Item ID only has one "A" and/or "B", another option could be to use a Summarize tool instead of a Multi-Row Formula tool:

image.png

Labels