- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Stack output table name
Hi,
I have a script that dynamically parses some of the info for stack table and would like to store the stack table as a new data table.
ystr1 = ":INFRASTRUCTURE Value, :INFRASTRUCTURE Value 1"
I am getting the following error
Name Unresolved: infra_updated..jmp in access or evaluation of 'infra_updated.jmp'
Unable to figure out why EvalInsert doesn't work for Output Table
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
Quotes need to be around the Output Table() specified name. Therefore, they need to be added to the string value for your output_name variable
ystr1 = ":INFRASTRUCTURE Value, :INFRASTRUCTURE Value 1";
infr = "Infrastructure Value";
data = "PPT";
output_name = "\!"infra_updated\!"";
gbStr = Eval Insert(
"dt << Stack(
columns(
^ystr1^
),
Source Label Column(^infr^ ),
Stacked Data Column(^data^),
Output Table(^output_name^ )
)"
);
Eval( Parse( gbStr ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
Jim already gave the reason what is going wrong in your script. I would suggest you use other methods than Eval(Parse()) as it can be extremely difficult to debug and you don't have syntax highlighting in script editor
Names Default To Here(1);
/*
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cols = {"age", "height"};
*/
cols = {"INFRASTRUCTURE Value", "INFRASTRUCTURE Value 1"};
infr = "Infrastructure Value";
data = "PPT";
output_name = "infra_updated";
dt_stacked = dt << Stack(
Columns(Eval(cols)),
Source Label Column(infr),
Stacked Data Column(data),
Output Table(output_name)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
Quotes need to be around the Output Table() specified name. Therefore, they need to be added to the string value for your output_name variable
ystr1 = ":INFRASTRUCTURE Value, :INFRASTRUCTURE Value 1";
infr = "Infrastructure Value";
data = "PPT";
output_name = "\!"infra_updated\!"";
gbStr = Eval Insert(
"dt << Stack(
columns(
^ystr1^
),
Source Label Column(^infr^ ),
Stacked Data Column(^data^),
Output Table(^output_name^ )
)"
);
Eval( Parse( gbStr ) );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
Jim already gave the reason what is going wrong in your script. I would suggest you use other methods than Eval(Parse()) as it can be extremely difficult to debug and you don't have syntax highlighting in script editor
Names Default To Here(1);
/*
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cols = {"age", "height"};
*/
cols = {"INFRASTRUCTURE Value", "INFRASTRUCTURE Value 1"};
infr = "Infrastructure Value";
data = "PPT";
output_name = "infra_updated";
dt_stacked = dt << Stack(
Columns(Eval(cols)),
Source Label Column(infr),
Stacked Data Column(data),
Output Table(output_name)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
I tried your solution but i am seeing this error. I do have the correct column names in the list.
"Column not found in access or evaluation of 'Stack' , Bad Argument"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Stack output table name
For me it works fine in JMP18 (and 17) when I test it with the example I left in the code
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
cols = {"age", "height"};
infr = "Infrastructure Value";
data = "PPT";
output_name = "infra_updated";
dt_stacked = dt << Stack(
Columns(Eval(cols)),
Source Label Column(infr),
Stacked Data Column(data),
Output Table(output_name)
);
Are you sure the column names are written correctly and they are in a list?