Alteryx Designer Desktop Discussions

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

Sorting pairs of data

PuffinPanic
9 - Comet
9 - Comet

Hi

 

Is it just me, or does anyone else start to write a post and in doing so manage to solve their own problem?

 

I have a data set that looks a bit like this:

SupplierAwardedSum contract valueCount of contracts
Supplier AYes123456
Supplier ANo100002
Supplier BYes11223311
Supplier BNo121231
Supplier CYes3334449
Supplier CNo343433
Supplier DYes6665554
Supplier ENo102451
Supplier FYes5555557

 

I want to sort it so that the output looks like this:

SupplierAwardedSum contract valueCount of contracts
Supplier BYes11223311
Supplier BNo121231
Supplier CYes3334449
Supplier CNo343433
Supplier FYes5555557
Supplier AYes123456
Supplier ANo100002
Supplier DYes6665554
Supplier ENo102451

The sort is based on the count of contracts field where 'Awarded'='yes', but I want to keep both (if present) entries for each supplier together, 'yes' in the 'Awarded' field should always come before 'no' if both are present. 

 

The section of workflow I created to do this looks like this:

PuffinPanic_0-1662735493095.png

 

 

(I've attached the workflow in case anyone wants to look at it)

 

Now I'm wondering if there was a better way or what alternative ways there are to do this. Any ideas?

 

I didn't just delete the post because hopefully this will be useful to someone else.

 

Looking forward to seeing your alternative workflows.

 

PuffinPanic

4 REPLIES 4
Christina_H
14 - Magnetar

Here's my version

Christina_H_1-1662736766631.png

 

 

DataNath
17 - Castor

Had a little play around and came up with this. Great that you figured it out but still posted for awareness & possible alternatives. Cheers!

 

My approach sorts on contract count to get the starting order of the Suppliers, then assigns a record ID once they're in the correct order, before filling the ID down to other records of the same supplier so they stick together as a pair in the final outcome. For the final result, I then sort on that Record ID before sorting descending on Awarded so that 'Yes' is always first.

 

DataNath_0-1662739526914.png

grazitti_sapna
17 - Castor

@PuffinPanic , Here is the updated workflow you just need to use some of the preparation tools and you will get your desired result.

 

Thanks!!

Sapna Gupta
PuffinPanic
9 - Comet
9 - Comet

Thanks everyone, some great alternative solutions there. I'll definitely be having a good look at them so that I can improve my own solution.

 

PuffinPanic

Labels