Syntaxhilfe für „Get Value Labels“.Hallo,
Ich entwickle ein Skript, das die Spalten in meinen Datentabellen durchläuft und eine Oberkategorie basierend auf einem bestimmten Satz von Wertebeschriftungen anwendet. (Wertbezeichnungen({0 = „Schlecht“, 25 = „Mittelmäßig“, 50 = „Gut“, 75 = „Sehr gut“, 100 = „Ausgezeichnet“}))
Ich brauche Hilfe, um die Syntax in meinem nicht funktionierenden Code unten richtig zu machen. Ich habe auch einige Testdaten angehängt. Vielen Dank im Voraus.
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} )}));
Automatisierung und SkripterstellungVerbraucher- und MarktforschungBetreff: Syntaxhilfe für „Get Value Labels“.Jemand anderes hätte vielleicht eine elegantere Lösung, aber das folgende Beispiel funktioniert:
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} )});
);
Betreff: Syntaxhilfe für „Get Value Labels“.Ja, danke, das sollte gut gehen!