Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Unique Tool Help

joaopmts
6 - Meteoroid

Hi Guys! How are you?

 

I need some help with the unique tool.

 

I have an example of my database, where billing account number is a ID for the customer, codigo_consulta is a id for a credit consult in the bank system and his score on that consult

 

joaopmts_1-1676483013393.png

 

My problem is, in my database i have some repeated id customers vinculated in repeated id consults and i must be only one billing account number and one codigo_consulta in the entire database and with de highest score possible.

 

But when I put a unique tool selecting either of any id, it will repeat or catch the lowest one. My target is to have an output like this.

 

 

joaopmts_0-1676482944971.png

 

Best regards

Joao

 

6 REPLIES 6
ShankerV
17 - Castor

Hi @joaopmts 

 

The best possible way is to sort and then do the unique.

 

joaopmts
6 - Meteoroid

Hi! @ShankerV , but it's already sorted. I have sorted by biiling account number and then by codigo_consulta. When I do the unique by codigo_consulta I will end up with the second account number with the lowest score and when i do by billing account number, I get the same codigo_consulta for both account numbers

ShankerV
17 - Castor

Hi @joaopmts 

 

Lets keep Colum A, B, C for better understanding and keeping it simple too.

 

Hope you are expecting only one unique value in Column B, with maximum value in column C.

 

Hope my understanding is right. Also one unique value per column A also.

 

Many thanks

Shanker V

 

joaopmts
6 - Meteoroid

Yes, you are right.

 

I forgot to metion, I have ordered by number of IDs of column B by IDs of colum A.

 

joaopmts_1-1676488970014.png

 

 

joaopmts_0-1676488901802.png

 

I think my example its not a perfect on since a unique selecting the colum A will work. But in some scenarios more IDs from column A is involved, I get repeated values on colum B.

 

So the perfect process its to get the first register from IDs from colum A and wipe the rest of them leaving the rest of IDs on column B free to be selected for other IDs from comlumn A.

 

Sorry for my bad english.

 

ShankerV
17 - Castor

Hi @joaopmts 

 

One way of doing this.

 

As requested, I have taken only column A and the max score from column C.

Then taken the column B where it will be unique.

 

Hope this helps...

 

ShankerV_0-1676490293407.png

 

Many thanks

Shanker V

joaopmts
6 - Meteoroid

For now it works, I will update this if any other problems comes up

 

Thanks @ShankerV 

Labels
Top Solution Authors