Expression issues with Rule engine Node

I created an expression in Rule Engine node but i have been getting error and can’t get pass the error.

Error message:for line 1 is Col 0: Expected a number, Boolean, string, column, a table property or flow variable reference.

Expression: If // Determine ‘Item A’ and ‘Item B’ dynamically based on high confidence and lift
$Item_A$ = $Support_Item_A$ >= $Support_Item_B$ ? $Antecedent$ : $Consequent$;
$Item_B$ = $Support_Item_A$ >= $Support_Item_B$ ? $Consequent$ : $Antecedent$;

// Check if it’s a combo offer and set the discount accordingly
$Discount$ = $Combo_Offer$ == true ? 0.2 : $Discount$;

// Mark items for removal based on support threshold
$Remove_Item$ = $Support$ < 0.005 ? true : false;

Hi @chicathy2011 and welcome to the forum.

The syntax of what you’ve written is not something the Rule Engine will understand. Usually it’s something like this:

$Month$ = "January" => $Number$ = 1

Where the antecedent is everything before the => and the consequent is everything after, and column names are specified by the $ characters.

Maybe you could write a bit of pseudocode that describes what you want to do and someone can help you out.

1 Like

Would surely help if you share your flow here.
Are we really talking about Rule Engine?
Rule engine can check but can’t do calculations. For that rather use col expressions or math node
If so I would rather expect an expression like

$Support_Item_A$ >= $Support_Item_B$ => ABC

1 Like

Thank you very much I found the solution for my current project. Now I am clear about how to proceed next.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.