This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I'm trying to implement a Rules Engine. The rules are stored in a excel file in the format mentioned below. Its similar to rules in the SQL Where clause. In the table below there can be multiple rules defined. In a single rule there can be mulitple Operands defined. eg; In Rule 1 currently two operands are used, there can be 10 operands. I'm trying to see how can I read this Dynamic columns in Alteryx and process it. Here is the approach I'm struggling to implement currently.
Read the Rules list from the excel file.
Iterate through the rows
In the same iteration, iterate through the column until the end of the column(ERROR_CODE).
Form a WHERE clause like SQL, maybe use Alteryx In-DB using the rules and generate the output as a csv with the list of Claim_numbers that conform to that rule.
Can you please let me know if there is a tool/ a better approach to solve this problem. I'm trying to find For-each loop function in Alteryx to iterate through the rows/ columns, but there seems to be none.
there isn't a loop function in alteryx, but there are Batch Macros and Iterative Macros that can run different criteria with each record.
However, you can accomplish your goal in a variety of ways without touching either of those macros. So to clarify, you want to keep a set of rules in excel which will then be brought into alteryx and applied to specific tables/fields? Is there any reason you can't just write the rules within alteryx as a field?
Thanks a lot Jarrod! I was able to replace the WHERE clause with the concat_formula that you generated. I connected it to SQL database to query. However I get this error because of the single quotes for values. eg: there are no single quotes around 'K08%'. I tried to use regex_replace the double quotes, but I think the dynamic input is generating quotes on its own. Can you please let me know if there is a better approach?