Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

IN function inA

lakshmidirisala
6 - Meteoroid

Hi

in other softwares, I can write the code like this DOB_YEAR NOT IN (1900:2015)

How can I write in alteryx?

 

please help.

 

thanks

8 REPLIES 8
Emil_Kos
17 - Castor
17 - Castor

Hi @lakshmidirisala,

 

This is the solution that I have in mind but probably there is an easier way

 

Emil_Kos_0-1614429951403.png

 

Qiu
20 - Arcturus
20 - Arcturus

@lakshmidirisala 
To my knowledge, Alteryx doest not have exact same function but  can definitely achieve it easily as well.

Capture2.PNG

Tyro_abc
11 - Bolide

Here is my approach , I tried two formulae to find if I need to keep the record or filter it out.  You can use these formula directly in "Filter" tool. 

 

arundhuti726_0-1614478395799.png

 

 

Regards

Arundhuti

ImadZidan
12 - Quasar

Hello @Tyro_abc ,

 

That is for sure a creative idea. I believe @lakshmidirisala is looking for a range rather than two specific years.

I adjusted your workflow Reg expression to look for a range see attached.

 

But I also think that may not play very well with @lakshmidirisala as he is looking for something to 

mimic a range or sequence as it is the case in Python and R.

 

 

 

 

Emil_Kos
17 - Castor
17 - Castor

Hi @ImadZidan,

 

I also believe that @lakshmidirisala is looking for.


Probably the easiest solution and fastest at the same time is the one provided by @Qiu as it will be the fastest.

Tyro_abc
11 - Bolide

@ImadZidan  yes, I agree. I do have doubt on the original requirement whether that is range like we do in Python or is that something like SQL Where clause.  In either way, at least one of the solutions we provided should work. 

 

Best Regards

Arundhuti

AbhilashR
15 - Aurora
15 - Aurora

Hi @lakshmidirisala, solutions posted by others on this thread are a great way to replicate the NOT IN function you are looking for in Alteryx. Having said that, Alteryx does support IN (or NOT IN) function within its tool but not in the way you are looking to replicate by giving the start and end year (i.e. range). You will have to explicitly build out your NOT IN statement values within quotes and include them in your formula. Something like the screenshot below:

AbhilashR_0-1614558624467.png

 

The NOT IN year values are hard-coded in my sample screenshot above, but if you wanted to make it dynamic, Dynamic Formula tool available as part of CREW Macros can do that for you. I hope this helps and thank you for posting your question on the Community!

MarqueeCrew
20 - Arcturus
20 - Arcturus

How about:

 

left([dob_year,) >= "1990"

AND

left([dob_year,) <= "2015"

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels