Hi!!
I’m trying to replicate an Alteryx conditional formula to Knime with the Rule Engine node.
Could you guys help me ?
IF [MONTH_BEG_DATE]>=[LFL_START_DATE]
AND
[MONTH_BEG_DATE] < DateTimeAdd([LFL_END_DATE],-30,‘days’) THEN
‘LFL’
ELSE
‘n_LFL’
ENDIF
All the columns are Date format
Thanks!
Please see this discussion
@gwhall6 If you could show me how to use the Rule Engine or Column Expression node for something like the below that would be awesome:
If Contains([Feeder Requisition Number], “Feeder”) or Contains([Feeder Requisition Number], “Evergreen”) THEN “Parent”
elseIf Contains([Feeder Requisition Number],“Fall”) THEN “Unknown”
elseIf ([Feeder Requisition Number] =“H1b”) THEN “Unknown”
elseIf IsNull([Feeder Requisition Number]) THEN “Individual”
elseIf Contains([Feeder Requisition Number], “Q”) THE…
Also, look at
3 Likes
Hi @hdelfis-crf ,
can you please provide more information? Do you have just one table with two date columns where, if the conditions are met, a certain column should been given back? Sample data always helps to better understand the intention, purpose and desired outcome.
Cheers
Mike
Hi mw,
Sorry about that!
Follow the attachment with the example, the result is the last column, where I can define if the flag is “LFL” or “n_LFL”
Hope it helps
cheers
example.xlsx (22.5 KB)
Hi there,
no worries. I think you’ve got to divide the challenge into:
Convert string to date (if not in date time format already) via String to Date&Time
Calculate time difference “DateTimeAdd([LFL_END_DATE],-30,‘days’)” via Date&Time Shift
Use rule engine
Here’s the solution Since the Excel reader automatically converts the dates I spared step #1 .
https://hub.knime.com/mw/spaces/Public/latest/Knime%20Forum%20Support/Rule%20engine%20with%20dates
Cheers
Mike
2 Likes
system
Closed
October 29, 2019, 6:57pm
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.