Alteryx Designer Desktop Discussions

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

Using the 'Contains' function

StephenG
6 - Meteoroid

Hello,

 

I am using the contains function to filter on just specific named strings within my data set as follows:

 

Contains([Product Type], "Asset Purchase Plan") or
Contains([Product Type], "Lease") or
Contains([Product Type], "Long Funding Lease")or

 

The problem is that this is returning any result with any of these words contained within data set, not the specific ones in the " ".

 

Can anyone provide some guidance on how to re-write this so it just returns the above?

 

Many thanks

 

 

 

 

9 REPLIES 9
carlosteixeira
15 - Aurora
15 - Aurora

Hi @StephenG, follows a working workflow. What version of Alteryx are you using? I hope it helps.

Carlos A Teixeira
MarqueeCrew
20 - Arcturus
20 - Arcturus
Could it be ther trailing or at the end of the formula?
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
StephenG
6 - Meteoroid

Hi,

 

Thanks for your response

 

I am using version 11.7.4

 

The problem is that I have other values in the data set such as 'Lease Regulated' which is also being returned, whereas I am trying to return just 'Lease' or "Long Funding Lease"

 

Thanks

 

 

LJoonas
7 - Meteor

Hi,

 

You don't need contains -function if you are looking for an exact match, regular equal sign = should do it. If you need values, that might have other thing like "Car Lease" and you would want this but not "Lease Regulated" you should first filter out these exceptional values that contain word "Lease" that you don't want and after that use the contain -function.

 

Hope this helps a bit.

carlosteixeira
15 - Aurora
15 - Aurora

hi @StephenG  follow new workflow

 

using:

REGEX_Match([Product Type], 'Asset Purchase Plan')
OR
REGEX_Match([Product Type], 'Lease')
OR
REGEX_Match([Product Type], 'Long Funding Lease')

I hope it helps.

best regards.

Carlos A Teixeira
StephenG
6 - Meteoroid

Really useful thanks all for the help

rohit782192
11 - Bolide

Hello ,

 

I tried but ran into a problem i want to check the data should include Asset Purchase Plan or Lease.

 

Neither way i am getting proper output

richmondbound
8 - Asteroid

Hi, 

I am trying to check if the concat_category contains "pizza", "burger", or "side" and "drink". As you can see from the example weekly challenge. What I am struggling with is how to check if the field does in fact contain these values. Unfortunately when I use the contains(pizza",concat_category) it returns 0. What I am realizing is that contains() is checking if the entire field contains the specific word i am looking for. Any thoughts on how to work around or how to deal with this?

nukamanoj
5 - Atom

If data under comments heading starts with "JP" then the value under "Department" column must become "JPY", If starts with "DE" then department should become "DEN". Others should remain as TSL. Please help to build workflow for this case.

Labels