「値ラベルの取得」構文ヘルプこんにちは、
データテーブルの列をループし、特定の値ラベルのセットに基づいてスーパーカテゴリを適用するスクリプトを開発しています。 (値ラベル({0 = "悪い"、25 = "普通"、50 = "良い"、75 = "非常に良い"、100 = "優れた"}))
以下の機能しないコードの構文を正しく理解するために助けが必要です。 テストデータも添付しました。 前もって感謝します。
Names Default To Here( 1 );
// Specify the column name
columnName = "36/5. Considering everything about the brand you use most often, how would you rate it overall?";
// Get the column reference
col = Column(columnName);
//test to see if the value labels contain 100 = "Excellent" and if so, apply a supercategory
if (Get Value Labels(col)["100"] == "Excellent",
col << Set Property( "Supercategories", {Group( "Top 2", {75,100} ), Group( "Bottom 2", {25,0} )}));
自動化とスクリプト作成消費者および市場調査Re: 「値ラベルの取得」構文ヘルプ他の人がもっと洗練された解決策を持っているかもしれませんが、以下の例は機能します。
Names Default To Here( 1 );
// Specify the column name
columnName = "36/5. Considering everything about the brand you use most often, how would you rate it overall?";
// Get the column reference
col = Column(columnName);
//test to see if the value labels contain 100 = "Excellent" and if so, apply a supercategory
lst = char(col << Get Value Labels); //get col properties as string
if(contains (lst, "100 = \!"Excellent\!""), //see if 100 = "Excellent" is in the string
col << Set Property( "Supercategories", {Group( "Top 2", {75,100} ), Group( "Bottom 2", {25,0} )});
);
Re: 「値ラベルの取得」構文ヘルプはい、ありがとう、これでうまくいくはずです!