community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Create a column based on another

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!

@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

Thank you!!

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.

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

Thanks, you're the man!

Labels