Hi again :)
D/M/Y date strings cannot be compared their large/small directly, but you can use the DateFormatter to convert D/M/Y to YYYYmmdd, and then compare the YYYYmmdd strings with < > <= >= operators.
Example for DateFromatter parameter settings:
Source Date Format: %d/%m/%Y
Destination Date Format: FME Date (%Y%m%d)
In the data flow, the ParameterFetcher or the AttributeCreator can be used to get the user parameters and add the values to each feature as their attributes.
After changing format of the date strings with the DateFormatter, you can filter the features based on the date value (YYYYmmdd format) with the Tester.
Takashi
Hi Takashi. Thank you so much for the reply.
The DateFormatter worked exactly what I wanted. But I was not able to get the correct output from Prompt Run Translation.
What I tried is-
- Renamed the Date column to 'Start Date' & 'End Date' and copied the attributes from 'Date' column to 'Start Date' and 'End Date' column.
- Now both the columns have same value.
- Made a Tester transformer with 'Begins With' and 'Ends With' clause.
- This is where the user needs to change the dates.
This is a temporary thing, but the output is not as I require.
More suggestions are welcoomed.
I don't think "Begins With" and "Ends With" operators are suitable to your case.
If all the attributes store date strings in YYYYmmdd format, you can determine if the Date is between Start and End with this test clause.
Start Date <= Date
AND
Date <= End Date
The <= or < operator can be used to compare YYYYmmdd date strings appropriately.
Don't forget to set the "Pass Criteria" parameter to "All Tests (AND)".
Begins/Ends With operator should be used to determine if a character string begins/ends with a specified string.