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

Alteryx Designer Desktop Discussions

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

Keep the highest count during a specific date

rxak
6 - Meteoroid

Hello!

 

I have a dataset, where I have used the Summarize tool to count different weather type during a day (Storm, Fog, Cold, Snow etc.). I would like to keep the Type where the count is the largest. 

 

My dataset

DateCountType
2016-01-024Cold
2016-01-0241Fog
2016-01-022Snow
2016-01-023Cold
2016-01-031Cold
2016-01-0317Fog
2016-01-034Snow


Expected outcome:

DateCountType
2016-01-0241Fog
2016-01-0317Fog

 

Thank you in advance!

5 REPLIES 5
DataNath
17 - Castor
17 - Castor

Hey @rxak, to do this you can just conduct a join back with the main data set based on the date and the max count equalling the count:

 

DataNath_0-1668869006369.png

gautiergodard
13 - Pulsar

Hey @rxak 

Here is the quickest way to do it! 

First you can use the summarize tool to find the max number of records per group (date) and then use this to join back to your original data set using both date and count as join attributes.

gautiergodard_0-1668870533105.png

 

Hope this helps!

 

ShankerV
17 - Castor

Hi @rxak 

 

One way of doing this. Please try and let me know.

 

ShankerV_0-1669005909934.png

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @rxak 

 

Step 1:

ShankerV_0-1669005961039.png

 

Step 2:

ShankerV_1-1669005976172.png

 

Step 3:

 

ShankerV_2-1669005995213.png

 

Many thanks

Shanker V

 

DenisZ
11 - Bolide

Please find attached solution

 

DenisZ_0-1669018485671.png

 

Labels