Alteryx Designer Desktop Discussions

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

Multiple Row Formula with 2 Conditions

mlgauthier
5 - Atom

Hello, 

 

I have a list of orders with different SKUs and I'm looking to reduce inventory accordingly. I want to have a total running based on order ID and SKU. 

 

So, if I sort the data by SKU, I get the remaining quantity. However, I can't have visibility on the whole order. If I don't have enough invenotry to fill a SKU in an order, I want to be able to not count the order in the remaining quantity (the order will be cancelled). 

 

For the moment, I am using the tool "sort" followed by the tool "multiple row formula". Here's the expression I'm using:

IF [Row-1:SKU]=[SKU] THEN [Row-1:Remaining]-[Quantity]

ELSE [Inventory]-[Quantity]

ENDIF

 


Here's a very abbreviated version of what I'm trying to do:

 

Order IDSKUQuantityInventoryRemaining QuantityExpected Remaining QuantityExplication
110123113-2 = 1
110215445-1 = 4
210143-3N/A1-4 = -3 (not possible)
2102252N/Aconsidering previous result
310113-401-1 = 0 (based on first row)

 

Thank you for your support :) 

5 REPLIES 5
aatalai
14 - Magnetar

@mlgauthier  does he attached workflow help 

mlgauthier
5 - Atom

That's partly helpful, thanks!

 

The “explanation” column doesn't need to be modeled. It was simply to support my explanations above.

 

I think it helps with the first part. Now, considering that item 101 of order #2 is unavailable, how do we make sure that item 102 of order #2 doesn't affect the inventory? The idea would be that the order will be processed differently so I don't want it to affect inventory.

 

Thanks again, I feel that I'm getting there. 

aatalai
14 - Magnetar

so to clarify if you can't do one part of the order you don't do any of it?

 

mlgauthier
5 - Atom

Exactly! The challenge is that the file I'm using contains a lot of SKUs and a lot of orders, so I can't link the orders together, especially since I don't know which other part of the order is on which row.

aatalai
14 - Magnetar

OK check this out a lot more complex but should answer your question

Labels