ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Using a String as a condition in a filter

sljoseph
7 - Meteor

 

Hello - I have a variable where the value of the variable may be Car = 1.  I need to use this value as a condition in a filter. This variable is created by a drop-down field in a excel spreadsheet.

 

The data looks something like this.  The variable can be 'Car = 1' OR 'House = 0' OR 'Cell Phone = 1', etc.

 

Customer NameCarHouseCell Phone
Peter Parker110
Tony Stark101
Natalia Romanova011

 

Simply using the variable in a filter does not seem to work.  Can anyone help with this?

 

19 REPLIES 19
flying008
15 - Aurora

Hi, @sljoseph 

 

Could you please tell me, 'Car = 1 and House = 0' or '[Car] = 1 and [House] = 0' ,  which is your actual value?  pls post the sample data.

sljoseph
7 - Meteor

It can be either.  I can tell the end user which to use, I just can't change that the data is coming from a field in a spreadsheet or that it's just one long string.  Whichever helps create the simplest solution, that is the one that we will choose.

caltang
17 - Castor
17 - Castor

Please give more scenarios and samples then. We can make it dynamic. 

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
sljoseph
7 - Meteor

Thank you @caltang 

 

The spreadsheet will only have one row, and the field name is Alert.  The Value can be, as an example, one of the following

 

Order NumberAlertDate
12387983731Car = 1 and House = 012/03/2025

 

OR 

 

Order NumberAlertDate
12387983731Car = 1 and House = 1 and Cell Phone = 012/03/2025

 

OR 

 

Order NumberAlertDate
12387983731House = 0 and Cell Phone = 112/03/2025

 

Any of these combinations can happen and many other combinations of the specific fields (Car, House, Cell Phone)

 

The data that is being filtered.

Customer NameCarHouseCell Phone
Peter Parker110
Tony Stark101
Natalia Romanova011
caltang
17 - Castor
17 - Castor

In your example, Tony Stark will fulfil Alert 1 and 3. Is that by design?

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
sljoseph
7 - Meteor

It's hard to explain without giving up too much proprietary information but yes Tony Stark can fulfill both Alert 1 and Alert 3.  View the Car, House and Cell Phone like flags and depending on the scenario being searched, that would determine what combination of Alerts have to be set.  House may be the only Alert needed so Car and Cell Phone no longer matter, or Car and Cell Phone may be needed, and House will not matter.

flying008
15 - Aurora

Hi, @sljoseph 

 

FYI.

 

录制_2025_12_30_14_31_11_496.gif

 

flying008_0-1767076899017.png

 

 

sljoseph
7 - Meteor

@flying008 - Thank you.  I can't see what your REGEX_CountMatches expression is.  Nor can I see what is in the 'RecordID = ' filter.  Is it possible for you to provide the file you created to do this?

flying008
15 - Aurora

Hi, @sljoseph 

 

1- The RecordID and Filter tools are useless for demo only. [Because you always have only 1 row.]

2- The Formula for you as below: 

flying008_0-1767143457665.png

 

sljoseph
7 - Meteor

Thank you @flying008. Your solution worked for me.  I appreciate everyone's help with this.

Labels
Top Solution Authors