Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Looking for Specific Value

knnwndlm
8 - Asteroid

Hi SME,

 

I have a Batch Macro that allocates the negative value into the positive value(s) within the same Tile.  What I want to create is an Iterative Macro inside the Batch Macro to **bleep** out those line items within the same tile that have the same value but opposite signs (see highlighted rows in the attached file).  In other words, I want to zero out those line items so that I won't have to allocate to the line items that contain the same values with the opposite sign.

 

Not sure if I can create an Iterative Macro inside a Batch Macro.  If so, not sure how to approach this.  Any suggestions?

 

Thanks,

kwl

10 REPLIES 10
jrlindem
12 - Quasar

Feels like this might be just a formula tool to flag the instances where this occurs and then just filtering them out?  -Jay

knnwndlm
8 - Asteroid

@jrlindem - But how do I perform this within each tile so that if I have the same amount elsewhere, it won't be picked up?  I need to go through each row within the tile to see if there's another row that has the same value with the opposite sign.

knnwndlm
8 - Asteroid

@jrlindem - Never mind.  Think I figured this out.  Thank you!

jrlindem
12 - Quasar

@knnwndlm Oh nice!  Did you get the embedded macro's working?  Or did you figure out the tiles + formulas? Curious what you worked out.  -Jay

knnwndlm
8 - Asteroid

@jrlindem - Thought I got it with the tiles + formula + multi-row formula but came to realize that it wasn't working due to other attributes embedded in the process. The issue I have is that I could have rows of embedded between the pos/neg values that I try to zero out.  It would have been easier if I could like them all up and then use the multi-row formula to do this.

jrlindem
12 - Quasar

Interesting.  What if you created a duplicate of the field and applied the absolute value ABS() of the negative values so that you can temporarily sort them according to number order within each tile, then do your multi-row formula against the original field (that still has the negative values).  You're only using the duplicate field with ABS() to create the sort order, then you abandon that later....

 

jrlindem_0-1760994947195.png

 

Your example data does not actually have any examples where there are other numbers in between the +/- sets, but I think this concept still works.  Just re-arrange your data so that the +/- values are next to each other, then use the multi-row formula.

 

-Jay

knnwndlm
8 - Asteroid

@jrlindem - What is the best way to zero out those rows?  I could do a filter, but I want to see those rows zeroed out for auditing purposes.  I wasn't able to use the Multi-Row Formula tool to do this in one swoop.  Any thoughts?

knnwndlm
8 - Asteroid

@jrlindem - I did it with two separate Multi-Row Formula. Guess it's not possible to do it with one.

jrlindem
12 - Quasar

Glad you got it figured out.  For your question, about the zero'd out rows, I would probably have recommended filtering, but since the filter tool splits it into [T]rue and [F]alse, you could bring the zero'd rows back into after you multi-row-formula'd to reunite them with the main rows.  But it appears you're good to go!

 

Happy Alteryx'ing and have a great rest of your week.  -Jay

Labels
Top Solution Authors