Select to view content in your preferred language

Add Days/Months to Datetime field using GeoEvent Processor

1933
4
04-06-2017 12:12 PM
TL2
by
Frequent Contributor

Using a filter I would like to update a field (field calculate) to add days and months to a date.  

Using a Rank of 1-4 as a filter and a known date I would like to add days and/or months based on which filter is input.

Can this be done in GeoEvent.  This is a HFS so I can't use sql.

Thanks!

0 Kudos
4 Replies
MarkBramer
Frequent Contributor

Hi Tucker,

I don't quite follow your scenario, but let's start with some semantics.  GeoEvent 'filters' examine incoming geoevents, evaluate them against some criteria, and if any geoevent meets the criteria, it will continue through the flow of the geoevent service.  Any geoevent that does not meet the criteria is simply dropped.  A filter cannot perform any field calculation, but there is a Field Calculator *processor*.  So I think you may be needing the Field Calculator processor...?  

I *think* I *kinda* understand what you're trying to do, and if I'm understanding you, you would need a mix of filters and processors.  Here is my 'pseudocode' of what I think you're trying to do.  For now, just let me know if my interpretation is correct, then we can move forward from there.

1. Geoevents are flowing in, and a geoevent contains a 'Rank' field (and probably other fields)

2.a. If a geoevent contains a Rank value of 1, use the Field Calculator processor to add some amount of days (maybe months) to a date.

2.b. If a geoevent contains a Rank value of 2, use the Field Calculator processor to add some amount of days (maybe months) to a date that's different than the days (or months) in 2.a.

2.c. Same as 2.b. but for Rank of 3 or 4.

Is that correct?  If so, is the 'base' date value something that's in the geoevent, or something else, like system time at which the geoevent is processed (i.e. 'now')?

Mark 

TL2
by
Frequent Contributor

2.a. is Correct.  Can that be done?

0 Kudos
MarkBramer
Frequent Contributor

Sorry, Tucker, I may have not been clear enough.  The whole thing I laid out with steps 1 through 2a/b/c is one complete scenario, not a choice (so I was looking for a yes/no answer, not an item from the individual steps.  

BUT, because I know at least 2a is correct, I think my interpretation of what you originally asked is generally correct.  So the answer is YES, you can do this.

Can you answer the last question I had: Is the date value that's being added to something that's in the geoevent, or something else, like system time at which the geoevent is processed (i.e. 'now')?

0 Kudos
TL2
by
Frequent Contributor

Date field will be populated with a date chosen by the user.  Rank will be blank.  If the user inputs a rank of '1', it takes the date field entry and adds 2 days.   If the user inputs a rank of '2', it takes the date field entry and adds 10 days....