Is there an easy way in JMP to summarize and export all Value labels information contained in a table (where multiple columns may have different Value Labels, but not all columns will have Value Labels)? Currently doing this manually by doing Recode on every Column with a Value Label, and doing Make Into Data Table. I then combine all the generated data tables together to get a stacked table (see sample files below).
For now, all Values are numerical, and Value Labels are characters, so stacking is not an issue.
Happy to get both interactive and scripting answers for this one, although I suspect it will be scripting.
Not sure if there is a direct interactive way to do this, but here is one way with scripting:
Names Default To Here(1);
//dt = Current Data Table();
dt = Open("$SAMPLE_DATA/CrabSatellites.jmp");
colNames = dt << Get Column Names("String");
dt_stack = New Table("Stacked_Value_Labels",
New Column("Values", Numeric, "Continuous", Format("Best", 12), ),
New Column("Labels", Character, "Nominal"),
New Column("Rating", Character, "Nominal")
);
For(i = 1, i <= N Items(colNames), i++,
colProp = Arg(Column(dt, colNames[i]) << Get Value Labels);
If(!IsEmpty(colProp) > 0,
For(k = 1, k <= N Items(colProp), k++,
currentColPropExpr = colProp[k];
dt_stack << Add Rows(
{Values = Arg(currentColPropExpr, 1), Labels = Arg(currentColPropExpr, 2), Rating = colNames[i]}
);
);
);
);