Alteryx Designer Desktop Discussions

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

Check if a particular value exists in a column and change formula accordingly

pratibhaprasad
5 - Atom

Hi Folks,

 

I am trying to recreate a formula like this in alteryx. Any way to do this?

Checking if a concatenation of a string exists in a column, if yes then replace another column based on that.

 

=IF(COUNTIF($B:$B,$A3&"HELLO")>0, "X", "Y")

4 REPLIES 4
mceleavey
17 - Castor
17 - Castor

Hi @pratibhaprasad ,

 

You need the REGEX_CountMatches function:

 

REGEX_CountMatches([String], "Hello")

 

This will return a 1 or 0 representing yes or no. You can then wrap that in an IF statement to do what you want.

 

M.



Bulien

pratibhaprasad
5 - Atom

I want to compare each cell with each value within a column, if the count is greater than 0 then the condition is fulfilled. 

pedrodrfaria
13 - Pulsar

Hi @pratibhaprasad 

 

I attached a practical example of how you can accomplish the function you mentioned.

 

If you need help understanding it, let me know, providing a sample dataset would be helpful as well, but the example attached covers checking for a concatenation of one column with a different column being compared and then updating an existing column.

 

Pedro.

SeanAdams
17 - Castor
17 - Castor

Hey @pratibhaprasad 

 

Depending on how you want the output to be structured, there are a few ways to go about this.

It may be worth attaching a sample of your desired output - here's a guide that may help 

https://community.alteryx.com/t5/Alteryx-Community-Resources/Posting-for-Fastest-Possible-Solution/t...

 

If what you're trying to do is to find columns that have string concatenations in them; and break these down into separate columns - then you could use the text-to-columns tool; or Regex - it all depends on what input you have and how you want the output to look.

 

 

 
Polls
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
Labels