Alteryx Designer Desktop Discussions

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

Unique tool selecting random values

Abhii2658
8 - Asteroid

I have the data in the following format with same Inv numbers and their corresponding values in P settings. 

I need to get the unique value where P Settings AA 01 or ZA01. Sometimes the tool is picking "-", How can control this. 

Also in cases where there are more then 1 value, in this case AA 01 and ZA01, can i pick the first one AA01. 

Here is the data 

Record ID

Inv Number

P Settings

 

1

1234

AA O1

 

2

1234

-

 

3

1234

-

 

4

1234

-

 

5

1234

ZA O1

 

6

1234

-

 

7

1234

-

 

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @Abhii2658 

 

You can use sample tool too in place of unique. Unique and sample will always give you the first occurred row. If you have specific priority order which should be picked over which let us know we can think of a logic.

 

atcodedog05_0-1629356416597.png

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Hi @Abhii2658 

 

Lets say you have a priority order where "-" should be picked at the last if no values else you would pick one which comes in alphabetic ascending you can setup logic like below.

 

Input:

Record ID Inv Number P Settings
1 1234 -
2 1234 -
3 1234 AA O1
4 1234 -
5 1234 ZA O1
6 1234 -
7 1234 -

 

Workflow: 

atcodedog05_0-1629356756988.png

 

And first row will be picked.

 

Hope this helps : )

Abhii2658
8 - Asteroid

Sorry, i dont think i made myself clear. Let me try again 

I need the unique of my RecordID which can have same PO Numbers 

For example below, i need the to pick one of many RecordID 2,, but not the one that has "-", need t pick the one that has a value and in this case ZA 01 

 

Record ID

Inv Number

P Settings

 

1

1234

-

 

2

1234

-

 

2

1234

-

 

2

1234

-

 

2

1234

ZA 01

 

4

1234

-

 

4

1234

-

 

5

1234

-

 

3

1234

-

 

4

1234

-

 

2

1234

-

 

6

1234

-

 

7

1234

-

 

atcodedog05
22 - Nova
22 - Nova

Hi @Abhii2658 

 

You should be able to accomplish it using the priority method where I am deprioritizing "-" and others will be prioritized in alphabetic order.

 

Workflow:

atcodedog05_0-1629363452635.png

Hope this helps : )

 

Labels