3229_es-ES
convertir datos numéricos en caracteresTuve que importar varias columnas de tipo de datos en jmp como numéricas (codificadas 1-4, por ejemplo). Me gustaría convertir los números en caracteres más significativos. Por ejemplo, en una columna etiquetada "SITIO", me gustaría realizar el siguiente cambio:
1 == DL
2 == SL
3 == KA
4 == MP
Si esto se hace en el editor de fórmulas con una serie de declaraciones IF, o si hay una forma más limpia. Si uso sentencias IF, ¿cómo puedo eliminar las columnas codificadas numéricamente originales? Gracias por adelantado.Re: convirtiendo datos numéricos a caracteres¿Qué hay de la columna, recode (la opción de menú, no una fórmula). Esto puede intercambiar los valores en su lugar, en otra columna o en una fórmula.Re: convirtiendo datos numéricos a caracteres
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-family: Arial;"> Creo que la función "emparejar"
funcionaría mejor Solo crea una nueva columna llamada SITE, y
use la siguiente fórmula (sustituyendo: Columna 1 con su referencia)
columna).
Partido (: Columna 1,
style = "font-family: Arial;">
1, "DL",
2, "SL",
3, "KA",
4, "MP"
);
style = "font-family: Arial;">
Si quieres convertirlo en un script, haz esto:
dt
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> current
tabla de datos
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> ()
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> site_col
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> =
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
dt
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> <<
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> New
Columna
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "SITE"
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
Personaje
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
Nominal
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
Fórmula (
style = "font-size: 10pt; font-family:" Courier New "; color: rgb (0, 0, 221);"> Coincidir
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> (
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">:
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> Columna
1
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 1
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "DL"
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 2
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "SL"
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 3
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "KA"
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
style = "font-size: 10pt; font-family:" Courier New "; color: teal;"> 4
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">,
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: púrpura;"> "MP"
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
)
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "">
)
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">)
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; font-family:" Courier New "; color: negro;"> site_col
style = "font-size: 10pt; font-family:" Courier New "; color: navy;"> <<
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
Eliminar fórmula
style = "font-size: 10pt; font-family:" Courier New "; color: navy;">;
style = "font-size: 10pt; font-family:" Courier New "; color: negro;">
style = "font-size: 10pt; line-height: 115%; font-family:" Courier New "; color: negro;"> dt
style = "font-size: 10pt; line-height: 115%; font-family:" Courier New "; color: navy;"> <<
style = "font-size: 10pt; line-height: 115%; font-family:" Courier New "; color: negro;">
eliminar columnas (
style = "font-size: 10pt; line-height: 115%; font-family:" Courier New "; color: navy;">:
style = "font-size: 10pt; line-height: 115%; font-family:" Courier New "; color: negro;"> Columna
1 )
style = "font-size: 10pt; line-height: 115%; font-family:" Courier New "; color: navy;">;
Comments
There are no comments yet