Dears,
I used rule engin node which has filled with some condition like these:
$CAB_TYPE$ = “031” AND MISSING $DA_ID$ => “264”
$CAB_TYPE$ = “033” AND MISSING $DA_ID$ => “106”
in next step I wanna set another condition which like this:
if (A= B) => value (clumn (Fee)) = 0
but my problem is rule engin create the new clumn to set value… or replcae whole of this clumn , I dont want to make new clumn. I wanna replce the value of specefic row with zero.
To be clear I need to run below order with something like this:
if A = B than “the Corresponding value of clumn Fee should be zero”.
with python I have used thise code, but I perefer to use knime node. is there any suggestion?
Dear @AlexanderFillbrunn,
Is there any way to compare tow string (one item from a file) and other item in rule engin?
if A=B than fee=> ‘0’
A red from XLSX.
Hi,
you mean you want to do what you did above, but one column comes from the rule engine and the other from an Excel file? In that case you first have to merge the tables somehow, most likely using a Joiner.
Kind regards
Alexander
Dear @AlexanderFillbrunn
Yes exactly, I want to import 2 stream in to rule engin. but as you know for large data like 100 M or more, the cost of join is to much (Time and Ram usage). Is there any other way? to be clear I want to make a comparision of one string between the file and the rule engin. meybe using of simple java snipp is better? is it?
Hi,
you mean you want to compare a column with a constant value that does not change for each row? In that case you should read the Excel file and extract the value to compare with into a flow variable. Can you show some minimal example data to highlight what you want to achieve?
Kind regards
Alexander
Dear @AlexanderFillbrunn,
Hi,
This is my table:
The value in our file is not with a constant value.
A
B
Fee
1100
99362987434
No action
1101202010
99362984434
No action
1101202020
99362981434
No action
110206012
99362978434
No action
111111
11111
0
1112
1112
0
1115
99362969434
No action
1123
99362966434
No action
1234
99362963434
No action
201212
99362960434
No action
….
…
…
A= read from excel file
B= the data in our rule engin
order: I want to compare the string of A with B and if its same the corispond Value in clumn Fee should be ‘0’
Hi,
okay, I see. But then how should KNIME know which row of the Excel Reader table to compare with which row from the Rule Engine? Is it guaranteed that both tables have the same number of rows? If that is the case, you can use the Column Appender node, which is more efficient than a join if you simply want to combine the rows by index.
Kind regards
Alexander
@AlexanderFillbrunn,
Unfortunatly both table have not same row number. so I have 4 option:
1-use join and continue the process.
2-use python code to make comparison between two clumn (python)
3-use java snipp simple to make comparison between two clumn (java)
4- suggest to knime team to develop rule engin node with two input leg
Hi,
I think Java Snippet won’t work because it also has only one input. If you use Python be aware that the data has to be transferred from the KNIME process to the Python process, so a Join might still be faster. What should a rule engine with two input ports do if the tables don’t even have the same number of rows like in your case? I think the only logical solution here is to use a join.
Kind regards
Alexander