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

Create a column based on another

JoaoFernandes
7 - Meteor

Hello all,

 

I have a pretty simple doubt and would greatly appreciate if anyone could help me. I have a simple database with only two columns - Date and Items Purchased. It looks like this:

 

DateItems purchased
1st July30
2nd July15
3rd July0
4th July0
5th July0
6th July35
7th July0
8th July0
9th July40
10th July40
11th July0
12th July0
13th July0
14th July0
15th July40
16th July40
17th July10
18th July0
19th July0
20th July15
21st July25
22nd July0

 

Im trying to create a new column named Distributed Items, which should be the items purchased distributed by dates. For this column, no single date can have more than 30 items purchased and the remaining ones should transition to the next date. Im trying to make it look like this:

 

DateItems purchasedDistributed items
1st July3030
2nd July1515
3rd July00
4th July00
5th July00
6th July3530
7th July05
8th July00
9th July4030
10th July4030
11th July020
12th July00
13th July00
14th July00
15th July4030
16th July4030
17th July1030
18th July00
19th July00
20th July1515
21st July2525
22nd July00

 

Unfortunately I can't write a Multi Row Formula that fits. Does anyone have a clue? Thank you!

5 REPLIES 5
patrick_digan
17 - Castor
17 - Castor

@JoaoFernandes Give the attached a try. I used a multi-row tool like this and then capped it to 30 in a formula tool:

Capture.PNG

JoaoFernandes
7 - Meteor

Thank you!!

JoaoFernandes
7 - Meteor

Hi again Patrick,

 

If I needed to have some negative values in my "Items Purchased" column (which means items returned, like this):

 

DateItems purchasedDistributed items
6th July3530
7th July05
8th July00
9th July300
10th July-300
11th July00
12th July4530
13th July-510
14th July00

 

 

How would you recommend a possible way to adjust the formula? Thanks again for your time.

patrick_digan
17 - Castor
17 - Castor

@JoaoFernandes Hopefully a simple modification to the multi-row will do the trick.

JoaoFernandes
7 - Meteor

Thanks, you're the man!

Labels