Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Mapping an Output Based on a New Condition and Reversing the Value Sign

bwortham32
7 - Meteor

I'm sure the subject line is super confusing, but I wasn't sure how to word this.  I have an output that looks like this:

 

State

Emp NoJobIncome
TX1234567Trainer1000
OK1234569Driver800
KS1234534Sales1200

 

I want to take this output with the exact same dimensions (State, Emp No) and map it to a new row where the Job is "UNASSIGNED" and the value sign is reversed so that the total is offset to $0.  The output would look like this below:

 

State

Emp NoJobIncome
TX1234567Trainer1000
TX1234567UNASSIGNED-1000
OK1234569Driver800
OK1234569UNASSIGNED-800
KS1234534Sales1200
KS1234534UNASSIGNED-1200

 

Any idea how to accomplish this?  I'm stuck...

 

Thanks!

3 REPLIES 3
jdunkerley79
ACE Emeritus
ACE Emeritus

The easiest way I can think of is:

 

- Use a record ID tool to store the record order

- Then use a formula tool to create the UNASSIGNED rows

- Union the output of the formula tool with the input and sort with the record id

 

sample attached

RodL
Alteryx Alumni (Retired)

You could do something like this...

 

Reverse Sign Question.png

You basically take your data, use the Formula tool hardcode the one field to UNASSIGNED and reverse the sign. Then Union it back to the original data. If you want to have the records next to each other, then just Sort on the key fields.

 

If there are only certain records you want changed, then just add a Filter tool with those conditions before the Formula tool.

bwortham32
7 - Meteor

Works like magic!

Labels