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.

offset the positive values (from right to left) using the first negative value found from

SimTom
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 -284 will first offset 930.7, G = 930.7-284, and F = 0

row 2 , G (-1140.75) will offset F first , F = 5580-1140.75 , G = 0
If -1140.75 was a larger value, it would offset 5580 first, then move on to 26.4, continuing until the negative amount is fully used or no more positive values are available.

 

Thank you in advance

 

ABCDEFG
00000-284930.7
26.400005580-1140.75
18-600000
4906.72805.9500-75000
-632700-380.67200.6700
0000-881.4068.2
000-0.497.41-677.470
0000402.33-578.06300
00750000-744.94
135.29133.440042850-319.38
00300323.78-0.31500
00045800-457.6
000718.411742.3-546.30
435.7828.93287.25-133.29410.2200
36.8452.62213.15311.360-106.840
0561.320-202.6405.0100
0331.570-427.8445.6300
000-54.2858.6200
1 REPLY 1
caltang
17 - Castor
17 - Castor

What have you done so far in your own workflow?

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels
Top Solution Authors