Alteryx Designer Desktop Discussions

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

Rearranging Data

TJ2
7 - Meteor

Below screenshot depicts what I'm trying to do. I have a list of Orders, it's settlements ,and the Allocation Percent and Area that are associated with them. I need the original data set to be transformed and look like the revised.
Somehow to determine for each order its last settlement. In this case, to associate the FIRST order with the FOURTH order and the associated Percent and Area.

 

TJ2_0-1591902490314.png

 

Any help would be appreciated. 

9 REPLIES 9
DavidP
17 - Castor
17 - Castor

If the 1st transaction is 100%, this will work, if not, we'll have to rethink.

 

DavidP_0-1591913793012.png

 

TJ2
7 - Meteor

Thanks. Unfortunately, the actual data is not as orderly. So the first item is not 100%. The actual list has 1000+ items with similar patterns. One order is allocated to another order, then allocated to another order etc...

TJ2
7 - Meteor

Here's another depiction to show the challenge:

TJ2_0-1591925937388.png

 

DavidP
17 - Castor
17 - Castor

If the sequence of transactions are not in the right order, you'll probably need an iterative macro. It would be helpful if you can share a small subset of representative data.

TJ2
7 - Meteor

The tables below are representative of the data set.

 

Allocation table

 

Main Order NameSettlement OrderPercentArea
FIRSTSECOND100%A1
SECONDTHIRD50%A1
SECONDTHIRD50%A1
THIRDFOURTH25%A1
THIRDFOURTH25%A2
THIRDFOURTH25%A3
THIRDFOURTH25%A4

 

Cost table

 

Main OrderCOST
FIRST100
DavidP
17 - Castor
17 - Castor

Have a look if the following is the type of thing you're looking for.

 

I've added a new column called product and added a second product with a different allocation and a different cost figure.

 

This should therefore be able to support multiple products and their allocation.

 

DavidP_0-1591979419822.png

 

TJ2
7 - Meteor

Thanks for the help so far. Is the key for this to work is that the cascading allocation logic has to be in sequential order. If the data is in random order, this will not work. So the source data needs to be sorted?

DavidP
17 - Castor
17 - Castor

Essentially yes. FIRST and FOURTH are determined with the min and max value of the [Order] field in the Multi-Row formula at the start, which is calculated based on the order of Settlement Order.

 

If you can sort by Product and Settlement date, that might work. I mentioned earlier that you might need an iterative macro if the transactions are not in the right order, for instance, if all you have to go on is the pairs FIRST -> SECOND, SECOND -> THIRD, but they are not in the right order, you'll have to search through the list by product and find the 1st pair, then the 2nd pairs, and so on.

TJ2
7 - Meteor

Thanks for your help with this.

Labels