Free Trial

Alteryx Designer Desktop Discussions

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

filtering the data based on each category level with conditions

Riiiiita
5 - Atom

Hi there, I'm new to Alteryx and I'm trying to filter the column which contains 4 categories, based on which I would like to apply the filter.

 

I'd appreciate it if someone with more experience could offer advice or point me in the right direction. Thank you!

 

Under the same destination, if the Transportation is "Any", then keep the record, and delete the rest; if there's no record as "Any", then keep the rest.

 

Database:

 

NameTransportationDestination

Amy

AnyHome
AmyBusHome
AmyCarSchool
AmyBusSchool
SamTramHome
SamLight RailHome
SamBikeHome
SamAnyHome
ChloeWalkHome
ChloeMotorbikeHome
ChloeFerryHome
ChloeScooterHome
BenTrainSchool
BenAnySchool
BenAnyHome
BenUberHome

 

Expected Result:

 

NameTransportationDestination

Amy

AnyHome
AmyCarSchool
AmyBusSchool
SamAnyHome
ChloeWalkHome
ChloeMotorbikeHome
ChloeFerryHome
ChloeScooterHome
BenAnySchool
BenAnyHome
4 REPLIES 4
binuacs
21 - Polaris

@Riiiiita a batch macro approach

 

image.png

Qiu
21 - Polaris
21 - Polaris

@Riiiiita 
We can filter that record containing "Any" then do a join with original data stream, then union with the Left Anchor data stream.

0821-Riiiiita.png

cristiane_dsc
7 - Meteor

I used Summarize to group by Name and Destination, and concatenate Transportation. Then I used a Formula to create a new column:

 

IF Contains([Concat_Transportation], "Any") THEN "Any" ELSE [Concat_Transportation] ENDIF

 

After that, I split the concatenated Transportation records back into lines (using comma as the separator). The Select tool removed the concatenated column and renamed the extra column created with the Formula tool, and finally the rows were sorted in ascending order by Name.

 

Captura de tela 2024-08-21 102323.jpg

 

I hope this helps!

flying008
15 - Aurora

Hi, @Riiiiita 

 

Another way for you :

 

录制_2024_08_22_14_57_21_146.gif

Labels
Top Solution Authors