<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Attribute Query - return Groups? in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174292#M4344</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think what you can do is first know the groups, which you can do by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; foreach (Field field in fl.LayerInfo.Fields)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (field.Domain is CodedValueDomain)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CodedValueDomain domain = field.Domain as CodedValueDomain;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var item in domain.CodedValues)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
//item.Key is an object this is what you need in your query

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your FeatureLayer was HomelandSecurity as in my previous post, you can see that ftype is CodedValueDomain and you can perform your query where "ftype = 10801".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 09:00:29 GMT</pubDate>
    <dc:creator>JenniferNery</dc:creator>
    <dc:date>2021-12-11T09:00:29Z</dc:date>
    <item>
      <title>Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174286#M4338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear All, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I used ESRI attribute query sample and returned all the values (commercial, commercial, agricultural, agricultural, etc) for that field. But I want only the groups (commericial, agricultural, etc) returned. How to construct the query so I can achieve this. thanks for the help, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Russel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 17:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174286#M4338</guid>
      <dc:creator>ducksunlimited</dc:creator>
      <dc:date>2010-10-07T17:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174287#M4339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can set your query's OutFields property so that it will return only the fields that you want it to return.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.OutFields.AddRange(new string[] { "FIELD_NAME" });
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:00:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174287#M4339</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T09:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174288#M4340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You can set your query's OutFields property so that it will return only the fields that you want it to return.&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.OutFields.AddRange(new string[] { "FIELD_NAME" });
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks for your reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to return only catogories for a field. For instance, I have a "LanUseType" field with values like commercial, agriculatural, wetlands, etc. How can I group by features using "LandUseType"? Help would be appreciated. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Russel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:00:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174288#M4340</guid>
      <dc:creator>ducksunlimited</dc:creator>
      <dc:date>2021-12-11T09:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174289#M4341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ESRI attribute queries are based on SQL queries. Since the ESRI API only allows one to specify the WHERE clause of a SQL query, I don't think one can perform a group query in this manner. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using transaction SQL,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want grouping to perform calculations, then one would need a GROUP BY clause in the SQL query.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you only want the unique values for a given field, then one would need a DISTINCT keyword in the SQL query.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 10:38:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174289#M4341</guid>
      <dc:creator>BrianPangtay</dc:creator>
      <dc:date>2010-10-13T10:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174290#M4342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Do you mean this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In this feature service &lt;/SPAN&gt;&lt;A href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ftype is CodedValueDomain, each number represent a category that can be one of the following values (Hydro-Meteorlogical, Public Health, ... Vehicle)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I want to see only features that are "Vehicle", my query's Where is "ftype = 10801"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 13:29:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174290#M4342</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2010-10-13T13:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174291#M4343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Do you mean this?&lt;BR /&gt;&lt;BR /&gt;In this feature service &lt;A href="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;ftype is CodedValueDomain, each number represent a category that can be one of the following values (Hydro-Meteorlogical, Public Health, ... Vehicle)&lt;BR /&gt;&lt;BR /&gt;If I want to see only features that are "Vehicle", my query's Where is "ftype = 10801"&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the reply. I would like to return each group (like Hydro-Meteorlogical, Vehicle, etc) as a row in a datagrid, so users can select a row and zoom to that group (multiple polygons). Can I construt the Query.Where clause to do this? Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 17:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174291#M4343</guid>
      <dc:creator>ducksunlimited</dc:creator>
      <dc:date>2010-10-13T17:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174292#M4344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think what you can do is first know the groups, which you can do by:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; foreach (Field field in fl.LayerInfo.Fields)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (field.Domain is CodedValueDomain)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CodedValueDomain domain = field.Domain as CodedValueDomain;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var item in domain.CodedValues)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
//item.Key is an object this is what you need in your query

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your FeatureLayer was HomelandSecurity as in my previous post, you can see that ftype is CodedValueDomain and you can perform your query where "ftype = 10801".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:00:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174292#M4344</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2021-12-11T09:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174293#M4345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I think what you can do is first know the groups, which you can do by:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp; foreach (Field field in fl.LayerInfo.Fields)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (field.Domain is CodedValueDomain)
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CodedValueDomain domain = field.Domain as CodedValueDomain;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (var item in domain.CodedValues)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
//item.Key is an object this is what you need in your query

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;If your FeatureLayer was HomelandSecurity as in my previous post, you can see that ftype is CodedValueDomain and you can perform your query where "ftype = 10801".&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help. I see this will work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But CodedDomain is only supported in 2.0 not 1.2 right?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174293#M4345</guid>
      <dc:creator>ducksunlimited</dc:creator>
      <dc:date>2021-12-11T09:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Attribute Query - return Groups?</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174294#M4346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes you're right CodedValueDomain is new to 2.0.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 19:30:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/attribute-query-return-groups/m-p/174294#M4346</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2010-10-13T19:30:54Z</dc:date>
    </item>
  </channel>
</rss>

