Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: ArunnHi,
I want to implement the case statement in lavastorm. I tried to achieve the same in IF statement, but I'm not getting an error, input variable is not getting resolved in the regex().
Input records:
flag:string, month:string,month1:string,month2:string,month3:st ring
Y,JAN18,FEB18,NULL,NULL
Y,FEB18,MAR18,NULL,NULL
N,JAN18,NULL,NULL,NULL
Y,NULL,APR18,NULL,NULL
Y,NULL,OCT18,NULL,MAY18
Y,NULL,DEC18,NULL,NULL
filter node :
Search_List1 = "JAN18,FEB18,MAR18,APR18,MAY18,JUN18,JUL18"
if (flag == "Y" and Search_List1.regexIsMatchI('month')) then test_output = 'month'
else if (flag == "Y" and Search_List1.regexIsMatchI('month1')) then test_output = 'month1'
else if (flag == "Y" and Search_List1.regexIsMatchI('month2')) then test_output = 'month2'
else if (flag == "Y" and Search_List1.regexIsMatchI('month3')) then test_output = 'month3'
else test_output = "NO "
emit test_output
Expected Output :
test_output
JAN18
FEB18
NO
APR18
MAY18
NO