laptop and a wrench

不具合

The AND operator does not work as expected in an advanced label expression.

最後に公開された状態: April 16, 2015 ArcGIS for Desktop
不具合 ID 番号 BUG-000084817
送信されましたJanuary 27, 2015
最終更新日January 19, 2021
適用対象ArcGIS for Desktop
見つかったバージョン10.1
サーバー プラットフォームWindows
クライアント プラットフォーム8.1
ステータスWill Not Be Addressed

参考情報

We apologize that we were unable to address this issue within the current product support cycle.  If the issue continues to affect your work in a supported release, please contact Technical Support.

対処法

Rather than using the AND operator in the label expression, create multiple Label Classes (one for each condition), use the SQL Query option to select features that meet the initial expression (such as Yes or No), and then use a simplified version of the expression to label the features. This allows users to break down the complex label expression and bypass the AND operator by working with multiple labels classes instead. For example: Original Expression: Function FindLabel ([YesNo], [ColorOption]) if ([YesNo] = "YES" AND [ColorOption] = "Red") then FindLabel = [YesNo] & vbNewLine & [ColorOption] elseif ([YesNo] = "NO" AND [ColorOption] = "Red") then FindLabel = [ColorOption]& vbNewLine &[YesNo]end ifEnd FunctionLabel Class one Yes:1. Open the layer Properties and click on the Labels tab2. Select “Define classes of features and label each class differently” form the Method dropdown3. Rename the current class to an appropriate name. 4. Click on the SQL Query… button - This allows users to set a query on the layer so that those features meeting this argument are the only ones shown with this label style5. Specify the SQL Query to be used for this label class and click OK- Example: SUBTYPE_YN = YES6. Click on the expression button and build the expression for this particular class and click OKFunction FindLabel ([YesNo], [ColorOption]) if ([ColorOption] = "Red") then FindLabel = [YesNo] & vbNewLine & [ColorOption]end ifEnd FunctionLabel Class two No:1. Click the Add… button to add the second label class.2. Give the new label class an appropriate name. In this case, use SUBTYPE_CD 2 because that is what this class grouped by.3. Click on the SQL Query… button 4. Specify the SQL Query to be used for this label class and click OK- Example: SUBTYPE_YN = NO5. Click on the expression button and build the expression for this particular class and click OKFunction FindLabel ([YesNo], [ColorOption]) if ([ColorOption] = "Red") then FindLabel = [ColorOption] & vbNewLine & [YesNo]end ifEnd FunctionThe first label class only label features that match the YES SQL Query and the second will only label those that match the NO SQL Query.

再現の手順

不具合 ID: BUG-000084817

ソフトウェア:

  • ArcGIS for Desktop

ArcGIS の専門家からヘルプを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動

このトピックについてさらに調べる