Comparing dates using Column Expression node

Hi,

I’m trying to do a simple comparison between 2 dates in 2 different columns by using Column Expression node and somehow it’s not working. But using Rule Engine node, I managed to get the right result.

Column Expression

Rule Engine

Result

Any idea what did I do wrong with the Column Expression node ?

Hello @ryudhanto,

this is a JavaScript thing. (Column Expressions is based on it.) This should work:

var d1 = new Date( column( “column1”) );
var d2 = new Date( column( “column2”) );
d1.getTime() == d2.getTime();

See here more about it:

If Column Expressions is not necessary I would perform this operation in Rule Engine node.

Br,
Ivan

2 Likes

Hi @ryudhanto , I agree with @ipazin , if you don’t need Column Expression, I would do this via Rule Engine instead.

However, if you really must use Column Expression, you can simply use the .equals() function like this:
column("ValueDate").equals(column("Value date"))

Results:
image

3 Likes

Even better @bruno29a :slight_smile:
Ivan

Thanks @ipazin and @bruno29a for the solution, it’s working now.

1 Like

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