Java Snippet error on if conditional

Good Day Everyone,

I have data like this
image

I has written code
image

but error on out_dateinput_Arr0
image

I want the logical could run if c_dateinput_Arr1 is not equal 1, then out_dateinput_Arr1 = c_dateinput_Arr1-1. Else out_dateinput_Arr1 = 12 and out_dateinput_Arr0 = c_dateinput_Arr0 - 1. But the ouput of out_dateinput_Arr0 is not what I want set condition before.

Thank Big

Assuming you have no other code, your if-block is defining no replacement value for out_dateinput_Arr0 so it is showing as a missing value. Try adding

out_dateinput_Arr0 = c_dateinput_Arr0;

to your if block.

2 Likes

Hi @Nanda_Rukmana,

well if you are not Java proficient maybe Column Expressions node with JavaScript syntax sound better?

https://www.w3schools.com/js/js_if_else.asp

Br,
Ivan

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