I want to do a multiple value selection in this query with an parameter input. The parameter Regiao_Estado gets a value like the example: [AC, DF] put in the line from the script:
lyr.definitionQuery = 'UF IN' '('Regiao_Estado')'
the whole code is here. The parameter Tabela1 only exists to get the value for the field Ano. The script will do a query to select values and after that get the sum of the field. For one value it`s ok, But I want for multiple values and maybe multiple fields selection.
Layer1 = arcpy.GetParameterAsText(0)
Tabela1 = arcpy.GetParameterAsText(1)
Regiao_Estado = arcpy.GetParameterAsText(2)
Ano = arcpy.GetParameterAsText(3)
mxd = arcpy.mapping.MapDocument("CURRENT")
for lyr in arcpy.mapping.ListLayers(mxd):
lyr.name = Layer1
lyr.definitionQuery = 'UF IN' Regiao_Estado
arcpy.Statistics_analysis(Layer1, "F:\AgroBD.gdb\Output1", [[Ano, "SUM"]], "")
arcpy.RefreshActiveView()
arcpy.RefreshTOC()
I get the error:
SyntaxError: invalid syntax (M6a.py, line 10)
Failed to execute (Consulta).
I tried many ways to solve this problem but don`t get any progress.