Ayuda de sintaxis "Obtener etiquetas de valor"Hola,
Estoy desarrollando un script que recorrerá las columnas en mis tablas de datos y aplicará una supercategoría basada en un determinado conjunto de etiquetas de valor. (Etiquetas de valor ({0 = "Pobre", 25 = "Regular", 50 = "Bueno", 75 = "Muy bueno", 100 = "Excelente"}))
Necesito ayuda para obtener la sintaxis correcta en mi código que no funciona a continuación. He adjuntado algunos datos de prueba también. Gracias de antemano.
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} )}));
Automatización y secuencias de comandosInvestigación del Consumidor y del MercadoRe: Ayuda de sintaxis "Obtener etiquetas de valor"Alguien más podría tener una solución más elegante, pero el siguiente ejemplo funciona:
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: Ayuda de sintaxis "Obtener etiquetas de valor"Sí, gracias, ¡esto debería funcionar muy bien!