I'm trying to write a JSL function that takes a column reference and creates new columns in the data table that the column belongs to.
Since all I have is a column reference (e.g. Column("x")) how do I figure out what data table that column belongs to so I can make sure to create the columns in the proper table?
Here's an example of what I'm trying to create:
colPlus3=function({col},
eval(substitute(expr(
new column("plus 3", formula(as column(c) + 3))), expr(c), col
)));
open ("$SAMPLE_DATA\Big Class.jmp");
open("$SAMPLE_DATA\Fitness.jmp");
colPlus3(column(data table("Big Class.jmp"), "Age"));
Notice that when you run this that the new column is added to the Fitness table. I want it added to Big Class.
Anyone have any ideas?