span8
span4
span8
span4
Hi there,
I am trying to filter (using tester) the data on the basis of dates (i.e.month and Year).I have converted the dates into desired format using DateTimeFormat function.When I run the tester, it does not give the right result.In the passed data tab I could see the dates row that should have been in the failed data tab.I have attached the screen shot of my test parameter.Could anyone guide where am I making the mistake?
If you can't see the logic of the tester here is the value
@DateTimeFormat (@DateTimeParse (@ value (INCIDENT_TIME), %Y-%m-%d),%m %Y) >= @DateTimeFormat(@DateTimeAdd(@DateTimeNow(),-P8M),%m %Y)
AND @DateTimeFormat(@DateTimeParse(@Value(INCIDENT_TIME), %Y-%m-%d),%m %Y) <= @DateTimeFormat(@DateTimeAdd(@DateTimeNow(),P3M),%m %Y)
Hi@muhammad_yasir, If you convert the datetime format intoStandard FME Date/Time Format, you can compare the datetime values by setting the Comparison Mode parameter in the Tester to "Date/Time".
Hi@takashi, I just noticed that I am getting following warning message when I run the tester.
Tester (TestFactory): TestFactory: Unable to do a date/time comparison of 'yyyymm' and 'yyyymm'.Comparing as strings instead.
My intention was to set these expressions.Both @DateTimeParse function and @DateTimeAdd function return a datetime value formatted inStandard FME Date/Time Format.
Doesn't this work for you?
@DateTimeParse(@Value(INCIDENT_TIME), %Y-%m-%d) >= @DateTimeAdd(@DateTimeNow(),-P8M) AND @DateTimeParse(@Value(INCIDENT_TIME), %Y-%m-%d) <= @DateTimeAdd(@DateTimeNow(),P3M)
Comparison Mode: Date/Time
If you need to compare only year and month part, this expression would be available.
@DateTimeFormat (@DateTimeParse (@ value (INCIDENT_TIME), %Y-%m-%d),%Y%m) >= @DateTimeFormat(@DateTimeAdd(@DateTimeNow(),-P8M),%Y%m) AND @DateTimeFormat(@DateTimeParse(@Value(INCIDENT_TIME), %Y-%m-%d),%Y%m) <= @DateTimeFormat(@DateTimeAdd(@DateTimeNow(),P3M),%Y%m)
This condition does not work.However, above mentioned condition does work
Awesome.It worked.Thanks for clarification.Last thing, Can I add multiple but different conditions in single tester?If yes, Can you explain how?
© 2019 Safe Software Inc |Legal