Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Filter Criteria by product type

SH_94
11 - Bolide

Hi community,

 

I would like to ask what will be the solution available if i want to filter the dataset criteria as below

Different data set contains either interim or final.

Filter Criteria.png

 

If the data set show as "Interim", then filter out " equal to or more than Period 13 ".

 

If the data set show as  "Final" , then include " equal to or more than Period 13".

 

Thank you in advance

8 REPLIES 8
Tam
9 - Comet

Hi @SH_94 

Is Period 13 a variable?

i.e. 

alteryx 1.PNG

SH_94
11 - Bolide

Hi @Tam ,

 

i just amended the question in my original post and feel free to comment.

 

Thank you.

CoG
14 - Magnetar

Why does Period 14 get filtered out too? From your criteria, you can use a Filter Tool with "Custom Filter":

NOT ([Type] = "Interim" AND [Period] = "Period 13")

 

But that wouldn't match the output you provided. Is there more dynamic logic involved?

SH_94
11 - Bolide

Hi @CoG ,

 

Sorry for the confusion caused, basically i plan to filter period 13 onward which mean if the period more than or equal to 13, then filter out.

 

Thanks

CoG
14 - Magnetar

Ah... Here is a sample workflow that does just that. Custom Filter is a little more complicated:

_Main.png

_Filter.png

Tam
9 - Comet

@SH_94 your Type = Final data output does not make sense if you want to include >= period 13 then you should only have 1 record. Period 6,11 & 12 does not match the equal to or more than 13 

 

regards 

Tam 

 

Tam
9 - Comet

Hi @SH_94 

I am still confuse about your condition for the final data. However, 

Let's make a few assumptions about your use case.

As a user I want the workflow to determine the type and apply the appropriate filtering rule for it, because at any given stage the source data type could be interim or final.  

I went down a rabbit hole: Smells like a Batch Marco, Smells like and App with checkbox and Detour.. then I wrote out the logic as follow: 

1. The input could have either Final or Interim for Type variable. 

2. Essentially an If statement for the filter tool along the line of:

 if type = interim then apply this logic: not ([Type]="Interim" and [Period]="Period 13")

 elseif type = final then apply this logic: not ([Type]="Final" and [Period]=null())

 

 

Then I wondered if I could write an If else statement into the custom filter function (I was not aware I could do this) . 

if [Type]="Interim" then
!([Type]="Interim" and tonumber(right( [period],Length([period])-7))>= 13)
elseif [Type]="Final" then
[Type]="Final" and [Period]!=null()
else
[Type]=Null()
endif

 

Attached is the sample workflow. 

HTH

Tam 

 

neridoli
5 - Atom

Good Information attaching equity product information

Labels
Top Solution Authors