How to select attribute specific values? [on hold]How to Select by Attributes on features sharing common value?What is a SQL Query to all values in a column with Select by Attribute in ArcGIS?How to select different values from two columns through Select By Attributes?How to assign a new name for values selected from two columns?Select by attributes is not selecting correctlySelect by attributes alternativeDeleting only specific attributes (columns) by name in an attribute table in QGIS with PythonSelect by character limitAutomatically select a feature from another layer based on shared attribute in QGISSelecting by attribute by specific characters fields

Should I cover my bicycle overnight while bikepacking?

Extract rows of a table, that include less than x NULLs

Which is the best way to check return result?

What exploit Are these user agents trying to use?

Is this a hacking script in function.php?

How to add frame around section using titlesec?

Does the Idaho Potato Commission associate potato skins with healthy eating?

Forming a German sentence with/without the verb at the end

Forgetting the musical notes while performing in concert

What is the most common color to indicate the input-field is disabled?

Plagiarism or not?

Unlock My Phone! February 2018

Personal Teleportation: From Rags to Riches

How do I gain back my faith in my PhD degree?

What mechanic is there to disable a threat instead of killing it?

Could the museum Saturn V's be refitted for one more flight?

Can I run a new neutral wire to repair a broken circuit?

How dangerous is XSS?

Bullying boss launched a smear campaign and made me unemployable

Valid term from quadratic sequence?

What type of content (depth/breadth) is expected for a short presentation for Asst Professor interview in the UK?

How can I deal with my CEO asking me to hire someone with a higher salary than me, a co-founder?

Ambiguity in the definition of entropy

What method can I use to design a dungeon difficult enough that the PCs can't make it through without killing them?



How to select attribute specific values? [on hold]


How to Select by Attributes on features sharing common value?What is a SQL Query to all values in a column with Select by Attribute in ArcGIS?How to select different values from two columns through Select By Attributes?How to assign a new name for values selected from two columns?Select by attributes is not selecting correctlySelect by attributes alternativeDeleting only specific attributes (columns) by name in an attribute table in QGIS with PythonSelect by character limitAutomatically select a feature from another layer based on shared attribute in QGISSelecting by attribute by specific characters fields













-1















I have table like



enter image description here



I need to select if R_no values is more than two same values and in ANGLE select first three numbers common and more than three attributes is same



enter image description here



Finally I want to select like blue highlighted attributes.










share|improve this question









New contributor




Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as unclear what you're asking by ahmadhanb, Vince, Hornbydd, Erik, csk 2 days ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


















  • To select multiple instances of R_no: summary statistics with a summary field of FID/OBJECTID case field of R_no to create a table with counts, optionally use table select where count_FID > 1 to create a new table with just R_no values that have a count of more than 1 instance then join by attributes R_no to R_no in the summary table extract and then finally select where count_FID > 1, right click on the layer and choose create layer from selected features and then remove the join on the selection layer - this will leave you with a layer where all the rows have a instance of R_no more than 1.

    – Michael Stimson
    2 days ago












  • thanks sir, but it is to lengthy. And what about Angle select starting three letters same attributes if more than three values.

    – Rakesh Reddy Posham
    2 days ago












  • Again, you can use the same technique to select from the selected layer but this could be simplified with python and dictionaries using a search cursor then iterating the first dictionary by key to select the matching R_no, ANGLE and DIST; the two-from-three duplication match can be evaluated and selection added to an existing selection (starting from no selection) of a layer. This is fairly advanced python, do you have reasonable python ability?

    – Michael Stimson
    2 days ago











  • i don't have knowledge about python so could u please give VB Script querry for above.

    – Rakesh Reddy Posham
    2 days ago












  • I don't know VB Script, VB.net with ArcObjects I do know but that's far too much to write for a single question. Use Model Builder if you want this to be repeatable and save into a toolbox.

    – Michael Stimson
    2 days ago















-1















I have table like



enter image description here



I need to select if R_no values is more than two same values and in ANGLE select first three numbers common and more than three attributes is same



enter image description here



Finally I want to select like blue highlighted attributes.










share|improve this question









New contributor




Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as unclear what you're asking by ahmadhanb, Vince, Hornbydd, Erik, csk 2 days ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.


















  • To select multiple instances of R_no: summary statistics with a summary field of FID/OBJECTID case field of R_no to create a table with counts, optionally use table select where count_FID > 1 to create a new table with just R_no values that have a count of more than 1 instance then join by attributes R_no to R_no in the summary table extract and then finally select where count_FID > 1, right click on the layer and choose create layer from selected features and then remove the join on the selection layer - this will leave you with a layer where all the rows have a instance of R_no more than 1.

    – Michael Stimson
    2 days ago












  • thanks sir, but it is to lengthy. And what about Angle select starting three letters same attributes if more than three values.

    – Rakesh Reddy Posham
    2 days ago












  • Again, you can use the same technique to select from the selected layer but this could be simplified with python and dictionaries using a search cursor then iterating the first dictionary by key to select the matching R_no, ANGLE and DIST; the two-from-three duplication match can be evaluated and selection added to an existing selection (starting from no selection) of a layer. This is fairly advanced python, do you have reasonable python ability?

    – Michael Stimson
    2 days ago











  • i don't have knowledge about python so could u please give VB Script querry for above.

    – Rakesh Reddy Posham
    2 days ago












  • I don't know VB Script, VB.net with ArcObjects I do know but that's far too much to write for a single question. Use Model Builder if you want this to be repeatable and save into a toolbox.

    – Michael Stimson
    2 days ago













-1












-1








-1








I have table like



enter image description here



I need to select if R_no values is more than two same values and in ANGLE select first three numbers common and more than three attributes is same



enter image description here



Finally I want to select like blue highlighted attributes.










share|improve this question









New contributor




Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I have table like



enter image description here



I need to select if R_no values is more than two same values and in ANGLE select first three numbers common and more than three attributes is same



enter image description here



Finally I want to select like blue highlighted attributes.







arcgis-desktop arcgis-10.3 attribute-table select-by-attribute select






share|improve this question









New contributor




Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Vince

14.8k32849




14.8k32849






New contributor




Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









Rakesh Reddy PoshamRakesh Reddy Posham

1




1




New contributor




Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Rakesh Reddy Posham is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as unclear what you're asking by ahmadhanb, Vince, Hornbydd, Erik, csk 2 days ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









put on hold as unclear what you're asking by ahmadhanb, Vince, Hornbydd, Erik, csk 2 days ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • To select multiple instances of R_no: summary statistics with a summary field of FID/OBJECTID case field of R_no to create a table with counts, optionally use table select where count_FID > 1 to create a new table with just R_no values that have a count of more than 1 instance then join by attributes R_no to R_no in the summary table extract and then finally select where count_FID > 1, right click on the layer and choose create layer from selected features and then remove the join on the selection layer - this will leave you with a layer where all the rows have a instance of R_no more than 1.

    – Michael Stimson
    2 days ago












  • thanks sir, but it is to lengthy. And what about Angle select starting three letters same attributes if more than three values.

    – Rakesh Reddy Posham
    2 days ago












  • Again, you can use the same technique to select from the selected layer but this could be simplified with python and dictionaries using a search cursor then iterating the first dictionary by key to select the matching R_no, ANGLE and DIST; the two-from-three duplication match can be evaluated and selection added to an existing selection (starting from no selection) of a layer. This is fairly advanced python, do you have reasonable python ability?

    – Michael Stimson
    2 days ago











  • i don't have knowledge about python so could u please give VB Script querry for above.

    – Rakesh Reddy Posham
    2 days ago












  • I don't know VB Script, VB.net with ArcObjects I do know but that's far too much to write for a single question. Use Model Builder if you want this to be repeatable and save into a toolbox.

    – Michael Stimson
    2 days ago

















  • To select multiple instances of R_no: summary statistics with a summary field of FID/OBJECTID case field of R_no to create a table with counts, optionally use table select where count_FID > 1 to create a new table with just R_no values that have a count of more than 1 instance then join by attributes R_no to R_no in the summary table extract and then finally select where count_FID > 1, right click on the layer and choose create layer from selected features and then remove the join on the selection layer - this will leave you with a layer where all the rows have a instance of R_no more than 1.

    – Michael Stimson
    2 days ago












  • thanks sir, but it is to lengthy. And what about Angle select starting three letters same attributes if more than three values.

    – Rakesh Reddy Posham
    2 days ago












  • Again, you can use the same technique to select from the selected layer but this could be simplified with python and dictionaries using a search cursor then iterating the first dictionary by key to select the matching R_no, ANGLE and DIST; the two-from-three duplication match can be evaluated and selection added to an existing selection (starting from no selection) of a layer. This is fairly advanced python, do you have reasonable python ability?

    – Michael Stimson
    2 days ago











  • i don't have knowledge about python so could u please give VB Script querry for above.

    – Rakesh Reddy Posham
    2 days ago












  • I don't know VB Script, VB.net with ArcObjects I do know but that's far too much to write for a single question. Use Model Builder if you want this to be repeatable and save into a toolbox.

    – Michael Stimson
    2 days ago
















To select multiple instances of R_no: summary statistics with a summary field of FID/OBJECTID case field of R_no to create a table with counts, optionally use table select where count_FID > 1 to create a new table with just R_no values that have a count of more than 1 instance then join by attributes R_no to R_no in the summary table extract and then finally select where count_FID > 1, right click on the layer and choose create layer from selected features and then remove the join on the selection layer - this will leave you with a layer where all the rows have a instance of R_no more than 1.

– Michael Stimson
2 days ago






To select multiple instances of R_no: summary statistics with a summary field of FID/OBJECTID case field of R_no to create a table with counts, optionally use table select where count_FID > 1 to create a new table with just R_no values that have a count of more than 1 instance then join by attributes R_no to R_no in the summary table extract and then finally select where count_FID > 1, right click on the layer and choose create layer from selected features and then remove the join on the selection layer - this will leave you with a layer where all the rows have a instance of R_no more than 1.

– Michael Stimson
2 days ago














thanks sir, but it is to lengthy. And what about Angle select starting three letters same attributes if more than three values.

– Rakesh Reddy Posham
2 days ago






thanks sir, but it is to lengthy. And what about Angle select starting three letters same attributes if more than three values.

– Rakesh Reddy Posham
2 days ago














Again, you can use the same technique to select from the selected layer but this could be simplified with python and dictionaries using a search cursor then iterating the first dictionary by key to select the matching R_no, ANGLE and DIST; the two-from-three duplication match can be evaluated and selection added to an existing selection (starting from no selection) of a layer. This is fairly advanced python, do you have reasonable python ability?

– Michael Stimson
2 days ago





Again, you can use the same technique to select from the selected layer but this could be simplified with python and dictionaries using a search cursor then iterating the first dictionary by key to select the matching R_no, ANGLE and DIST; the two-from-three duplication match can be evaluated and selection added to an existing selection (starting from no selection) of a layer. This is fairly advanced python, do you have reasonable python ability?

– Michael Stimson
2 days ago













i don't have knowledge about python so could u please give VB Script querry for above.

– Rakesh Reddy Posham
2 days ago






i don't have knowledge about python so could u please give VB Script querry for above.

– Rakesh Reddy Posham
2 days ago














I don't know VB Script, VB.net with ArcObjects I do know but that's far too much to write for a single question. Use Model Builder if you want this to be repeatable and save into a toolbox.

– Michael Stimson
2 days ago





I don't know VB Script, VB.net with ArcObjects I do know but that's far too much to write for a single question. Use Model Builder if you want this to be repeatable and save into a toolbox.

– Michael Stimson
2 days ago










1 Answer
1






active

oldest

votes


















1














Your question is a bit unclear. If you want to select first three rows if number of features in each R_no group is larger than two, code below should work. Execute in python window with the table/feature class added to the map. Im using collections.defaultdict to Group.



import arcpy
from collections import defaultdict

layer = 'somelayeraddedtoArcMap' #Change
group_field = 'R_no' #Change

oid_field = arcpy.Describe(layer).OIDFieldName
d = defaultdict(list)

#Group oids together by Group_field
with arcpy.da.SearchCursor(layer,[group_field, oid_field]) as cursor:
for group, oids in cursor:
d[group].append(oids)

oids_to_select = []
for group, oids in d.iteritems(): #d.items() in python3/ArcGIS Pro
if len(oids)>2: #if more than 2 in group
oids_to_select.extend(oids[:3]) #:3 add first Three oids to list

sql = "0 IN1".format(arcpy.AddFieldDelimiters(layer, oid_field), tuple(oids_to_select))
arcpy.SelectLayerByAttribute_management(in_layer_or_view=layer,
where_clause=sql)





share|improve this answer































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    Your question is a bit unclear. If you want to select first three rows if number of features in each R_no group is larger than two, code below should work. Execute in python window with the table/feature class added to the map. Im using collections.defaultdict to Group.



    import arcpy
    from collections import defaultdict

    layer = 'somelayeraddedtoArcMap' #Change
    group_field = 'R_no' #Change

    oid_field = arcpy.Describe(layer).OIDFieldName
    d = defaultdict(list)

    #Group oids together by Group_field
    with arcpy.da.SearchCursor(layer,[group_field, oid_field]) as cursor:
    for group, oids in cursor:
    d[group].append(oids)

    oids_to_select = []
    for group, oids in d.iteritems(): #d.items() in python3/ArcGIS Pro
    if len(oids)>2: #if more than 2 in group
    oids_to_select.extend(oids[:3]) #:3 add first Three oids to list

    sql = "0 IN1".format(arcpy.AddFieldDelimiters(layer, oid_field), tuple(oids_to_select))
    arcpy.SelectLayerByAttribute_management(in_layer_or_view=layer,
    where_clause=sql)





    share|improve this answer





























      1














      Your question is a bit unclear. If you want to select first three rows if number of features in each R_no group is larger than two, code below should work. Execute in python window with the table/feature class added to the map. Im using collections.defaultdict to Group.



      import arcpy
      from collections import defaultdict

      layer = 'somelayeraddedtoArcMap' #Change
      group_field = 'R_no' #Change

      oid_field = arcpy.Describe(layer).OIDFieldName
      d = defaultdict(list)

      #Group oids together by Group_field
      with arcpy.da.SearchCursor(layer,[group_field, oid_field]) as cursor:
      for group, oids in cursor:
      d[group].append(oids)

      oids_to_select = []
      for group, oids in d.iteritems(): #d.items() in python3/ArcGIS Pro
      if len(oids)>2: #if more than 2 in group
      oids_to_select.extend(oids[:3]) #:3 add first Three oids to list

      sql = "0 IN1".format(arcpy.AddFieldDelimiters(layer, oid_field), tuple(oids_to_select))
      arcpy.SelectLayerByAttribute_management(in_layer_or_view=layer,
      where_clause=sql)





      share|improve this answer



























        1












        1








        1







        Your question is a bit unclear. If you want to select first three rows if number of features in each R_no group is larger than two, code below should work. Execute in python window with the table/feature class added to the map. Im using collections.defaultdict to Group.



        import arcpy
        from collections import defaultdict

        layer = 'somelayeraddedtoArcMap' #Change
        group_field = 'R_no' #Change

        oid_field = arcpy.Describe(layer).OIDFieldName
        d = defaultdict(list)

        #Group oids together by Group_field
        with arcpy.da.SearchCursor(layer,[group_field, oid_field]) as cursor:
        for group, oids in cursor:
        d[group].append(oids)

        oids_to_select = []
        for group, oids in d.iteritems(): #d.items() in python3/ArcGIS Pro
        if len(oids)>2: #if more than 2 in group
        oids_to_select.extend(oids[:3]) #:3 add first Three oids to list

        sql = "0 IN1".format(arcpy.AddFieldDelimiters(layer, oid_field), tuple(oids_to_select))
        arcpy.SelectLayerByAttribute_management(in_layer_or_view=layer,
        where_clause=sql)





        share|improve this answer















        Your question is a bit unclear. If you want to select first three rows if number of features in each R_no group is larger than two, code below should work. Execute in python window with the table/feature class added to the map. Im using collections.defaultdict to Group.



        import arcpy
        from collections import defaultdict

        layer = 'somelayeraddedtoArcMap' #Change
        group_field = 'R_no' #Change

        oid_field = arcpy.Describe(layer).OIDFieldName
        d = defaultdict(list)

        #Group oids together by Group_field
        with arcpy.da.SearchCursor(layer,[group_field, oid_field]) as cursor:
        for group, oids in cursor:
        d[group].append(oids)

        oids_to_select = []
        for group, oids in d.iteritems(): #d.items() in python3/ArcGIS Pro
        if len(oids)>2: #if more than 2 in group
        oids_to_select.extend(oids[:3]) #:3 add first Three oids to list

        sql = "0 IN1".format(arcpy.AddFieldDelimiters(layer, oid_field), tuple(oids_to_select))
        arcpy.SelectLayerByAttribute_management(in_layer_or_view=layer,
        where_clause=sql)






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 2 days ago

























        answered 2 days ago









        BERABERA

        16.9k62044




        16.9k62044