Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Offset right positive with right negative

Ektaa
5 - Atom

Hi All, 

Could I please request your help with building a workflow to process the dataset below?

What I want to achieve is: offset the positive values (from right to left) using the first negative value found from the right. The goal is to turn the positive values into zero by deducting the negative amount, and leave any remaining negative balance in its original column.

For example, in the case below, the value -750 will first offset 2805.95, making it 0, and the resulting cell will contain 2805.95 - 750.
If -750 was a larger value, it would offset 2805.95 first, then move on to 4906.7, continuing until the negative amount is fully used or no more positive values are available.

4906.72805.9500-75000

 

 

Thanks in advance

Input sample -

ABCDEFG
000-4440064.43
000001182.98-54
00679.76000-1577.81
056470000-614.83
001240000-3120
0036700-65000
00000-24841930.7
236.40000155-11640.75
000550-55.10
00000-1543.1225
0000078-225
00000631.14-577.67
001884000-4466
0000-166.04177.390
18-600000
4906.72805.9500-75000
1 REPLY 1
KGT
13 - Pulsar

Is this an assignment question or something?

 

For 2 different users to post the same question with a different dataset within 2 days of each other. Both with no workflow showing an attempt...

 

RecordID, Transpose, and Multi-row are your friend here. Once transposed, you can sort it whatever way you want and then RunningTotal it with a formula afterwards to work out whether you've exceeded your capacity.

Labels
Top Solution Authors