I am builder model that users will be able to select values of year in range i.e 5 or 10years interval. The Year picklist will look like this in the tool. How can I do this in ArcGIS model builder ?
You could create a text string variable, set it as a parameter, and in the Model Options parameters, use a filter to create the list of choices.
Then use the Calculate Value tool to convert that string to a SQL expression, like this:
"YEAR >= {} AND YEAR <= {}".format("%Year Range%"[0:4], "%Year Range%"[5:])
The above expression would yield for your first choice "1967-1971":
YEAR >= 1967 AND YEAR <= 1971
Thanks for your reply @Curtis Price I did as you instructed and it worked, but however i did same for Months in the year i.e instead of using YEAR, I use MONTH
MONTH >= JANUARY AND MONTH <= APRIL
But it shows empty output, what could be wrong? or it can only be used for numeric but not text or what could be the issue?
I think it is working but it selects alphabetically i.e if I select from April it will select all values of month from A-S, but if I select from January to April, it returns null because J does come before A.. how can i solve this to make it select January to April or September to December to return a value.
I think it is working but it selects alphabetically i.e if I select from April it will select all values of month from A-S, but if I select from January to April, it returns null because J does not come before A.. how can i solve this to make it select January to April or September to December to return a value.@Curtis Price .
A value list filter for the parameter?
if i understand your question...Yes
I am not well skilled in python...it would be best to it in modelbuilder if possible..Thanks
Thanks.