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 Name | Car | House | Cell Phone |
| Peter Parker | 1 | 1 | 0 |
| Tony Stark | 1 | 0 | 1 |
| Natalia Romanova | 0 | 1 | 1 |
Simply using the variable in a filter does not seem to work. Can anyone help with this?
Solved! Go to Solution.
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.
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.
Please give more scenarios and samples then. We can make it dynamic.
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 Number | Alert | Date |
| 12387983731 | Car = 1 and House = 0 | 12/03/2025 |
OR
| Order Number | Alert | Date |
| 12387983731 | Car = 1 and House = 1 and Cell Phone = 0 | 12/03/2025 |
OR
| Order Number | Alert | Date |
| 12387983731 | House = 0 and Cell Phone = 1 | 12/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 Name | Car | House | Cell Phone |
| Peter Parker | 1 | 1 | 0 |
| Tony Stark | 1 | 0 | 1 |
| Natalia Romanova | 0 | 1 | 1 |
In your example, Tony Stark will fulfil Alert 1 and 3. Is that by design?
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 - 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?
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:
Thank you @flying008. Your solution worked for me. I appreciate everyone's help with this.