I'm trying to get date selector interface for my end users so they will be able to define YTD date range on their side (1-OCT up to first day of month)
The issue I have is how to setup the expression part so it would be captured by interface buttons.
Solved! Go to Solution.
For the most part it looks like you have it set up correctly - just maybe some extra tools.
I would just use a single Date interface tool, connected to one and only Filter tool.
If it is always going to be YTD then you could use a formula like this:
[Date]>=(ToString(DateTimeYear('2018-01-01'))+'-01-01')
And
[Date]<DateTimeTrim('2018-01-01','month')
Have the Update tool replace 2018-01-01 with the date coming in from the Date Interface tool.
@patrick_mcauliffe - you file is not working, could you re-send ?
I've attached a new one which is much more simplified.
You'll have to save first, then right click --> edit to see how it works and build off of it.
Great thanks @patrick_mcauliffe but still user needs to check both dates at his end.
@mszpot89 Again, you'll probably have to modify this to suit your specific need; but attached is how I would do it if you want the user to be able to select both start and end months.
@patrick_mcauliffe I did one litle edit ;)
If I wanted 10-1-2017 to 12-1-2017 range the workflow returns 11-1-2017 to 12-1-2017, this is how I accommodated it:
[Month]>=DateTimeAdd('2018-01-01',-1,'month')
And
[Month]<DateTimeTrim('2018-02-01','month')
Looks like that's happening because the formula is time stamp specific.
Try this formula instead:
[Month]>DateTimeAdd(DateTimeTrim('2018-01-01','month'),-1,'day')
And
[Month]<DateTimeTrim('2018-02-01','month')
This works as well @patrick_mcauliffe
[Month]>=DateTimeAdd('2018-01-01',-1,'month') And [Month]<DateTimeTrim('2018-02-01','month')