Select to view content in your preferred language

Geoevent Field Calculator - If > elseif > then

1176
1
10-05-2017 10:19 AM
AllenScully
Frequent Contributor

Trying to use the field calculator processor in a Geoevent service to look at an existing field and generate a Y/N value that gets written into a different column based on the values of the other field - 

I know VB doesn't work in the field calculator, so I'm wondering how to code the expression - 

basically it's this:

IF field1 in ('AF','AM','AV','IH') then field2 = 'Y'

else field2 = 'N'

Can this be done in the simple field calculator processor?  Hard to find documentation on coding these expressions.

Thanks - 

Allen

0 Kudos
1 Reply
GarrettMelvin
Regular Contributor

I know this is an older thread, but have you tried a Choice Element?  You could setup a choice with "field1 = 'AF' or field1 = 'AM' or field1 = 'AV'  or field1 = 'IH'", then follow with a field mapper that hard codes field2 as 'Y'.  In your choice element enable the "Otherwise" option, then follow with a field mapper that hard codes field2 as 'N'.  Finally merge the flows together for your output.  

GarrettMelvin_0-1738783488533.png

GarrettMelvin_3-1738783695391.png

 

GarrettMelvin_1-1738783508928.png

GarrettMelvin_2-1738783518363.png

 

0 Kudos