We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Conditional Filtering Based on Hierachy

np123
6 - Meteoroid

Hi everyone, 

 

I need some help regarding conditional filtering. I tried to look for solutions but was not able to find any. 

Here's a sample data:

input:                                                                                                  output:

XPYearTypeY XPYearTypeY
X12342022OY X12342022FY
X12342022FY X12342023FY
X12342023OY X12342021OY
X12342023FY X123452023OY
X12342021OY X123452022OY
X123452023OY X123452021AY
X123452022OY      
X123452021OY      
X123452021FY      
X123452021AY      

 

Basically, I need to filter based on a hierarchy key on column Year and Type. For example in this, A > F > O. E.g. for 1234 in 2022 since both O and F exist, we just want F. However, in 12345 2023, only O exists so we will take O. X and Y are misc columns whose data should be kept. At the very end, only one row for each year should exist. 

 

Any help is appreciated. 

1 REPLY 1
apathetichell
20 - Arcturus

create numeric values for f/o/a - wherein f is either the largest or smallest number.

use summarize tool in group by X/P/Year/Y  - take the max of your numeric equivalent colum of Type (or minimum if F is the minimum). Join it back on the numeric equivalent/X/P/Year/Y

 

 

Labels
Top Solution Authors