<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Column Name as Variable (Very Simple) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521898#M74695</link>
    <description>&lt;P&gt;I apologize but I do not understand how this could help me..&lt;/P&gt;&lt;P&gt;Maybe I wasn't clear in my question..&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jul 2022 15:00:36 GMT</pubDate>
    <dc:creator>Valerio</dc:creator>
    <dc:date>2022-07-15T15:00:36Z</dc:date>
    <item>
      <title>Column Name as Variable (Very Simple)</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521814#M74691</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling with a very simple problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to select a column name using a variable. Please see below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;List = {"A","B","C"};
For( 
	i=1, 
	i&amp;lt;=nitems(List), 
	i++, 
	Add Columns from Update Table( :Name(List[i]) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, JMP does not accept anything inside ":Name()" that isn't an &lt;STRONG&gt;&lt;U&gt;explicit&lt;/U&gt;&lt;/STRONG&gt; quoted string.. In fact, "List[i]" is a quoted string, but the code doesn't even run.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I get around this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:51:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521814#M74691</guid>
      <dc:creator>Valerio</dc:creator>
      <dc:date>2023-06-10T23:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Column Name as Variable (Very Simple)</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521872#M74694</link>
      <description>&lt;P&gt;Here is how I would accomplish what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;New Table( "Big Class",
	Add Rows( 40 ),
	New Column(
		["en" =&amp;gt; "name", "ja" =&amp;gt; "名前", "x-id" =&amp;gt; "S_name_Col", "zh-CN" =&amp;gt; "姓名"],
		Character,
		"Nominal",
		Set Property(
			"Notes",
			["en" =&amp;gt; "...usually used as a label variable in plots",
			"ja" =&amp;gt; "散布図のラベル変数として使用する。",
			"x-id" =&amp;gt; "S_usually_used_as_a_label_variable_Not",
			"zh-CN" =&amp;gt; "...通常用作图中的标签变量"]
		),
		Set Values(
			{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT",
			"BARBARA", "ALICE", "SUSAN", "JOHN", "JOE", "MICHAEL", "DAVID", "JUDY",
			"ELIZABETH", "LESLIE", "CAROL", "PATTY", "FREDERICK", "ALFRED", "HENRY",
			"LEWIS", "EDWARD", "CHRIS", "JEFFREY", "MARY", "AMY", "ROBERT",
			"WILLIAM", "CLAY", "MARK", "DANNY", "MARTHA", "MARION", "PHILLIP",
			"LINDA", "KIRK", "LAWRENCE"}
		),
		Set Display Width( 0 )
	),
	New Column(
		["en" =&amp;gt; "age", "ja" =&amp;gt; "年齢", "x-id" =&amp;gt; "S_age_Col", "zh-CN" =&amp;gt; "年龄"],
		Numeric,
		"Ordinal",
		Format( "Fixed Dec", 5, 0 ),
		Set Property(
			"Notes",
			["en" =&amp;gt; "Explore data adventurously",
			"ja" =&amp;gt; "年齢別にデータを探索する。",
			"x-id" =&amp;gt; "S_Explore_data_adventurously_Not",
			"zh-CN" =&amp;gt; "大胆地探究数据"]
		),
		Set Values(
			[12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14,
			14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 16, 16,
			16, 17, 17, 17]
		),
		Set Display Width( 0 )
	),
	New Column(
		["en" =&amp;gt; "sex", "ja" =&amp;gt; "性別", "x-id" =&amp;gt; "S_sex_Col", "zh-CN" =&amp;gt; "性别"],
		Character( 1 ),
		"Nominal",
		Set Property(
			"Notes",
			["en" =&amp;gt; "Explore data adventurously",
			"ja" =&amp;gt; "性別でデータを探索する。",
			"x-id" =&amp;gt; "S_Explore_data_adventurously_2_Not",
			"zh-CN" =&amp;gt; "大胆地探究数据"]
		),
		Set Values(
			{"F", "F", "F", "F", "F", "M", "M", "M", "F", "F", "F", "M", "M", "M",
			"M", "F", "F", "F", "F", "F", "M", "M", "M", "M", "M", "M", "M", "F",
			"F", "M", "M", "M", "M", "M", "F", "F", "M", "F", "M", "M"}
		),
		Set Display Width( 0 )
	),
	New Column(
		["en" =&amp;gt; "height",
		"ja" =&amp;gt; "身長(インチ)",
		"x-id" =&amp;gt; "S_height_Col",
		"zh-CN" =&amp;gt; "身高"],
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 5, 0 ),
		Set Property(
			"Notes",
			["en" =&amp;gt; "Explore data adventurously",
			"ja" =&amp;gt; "データを探索する。二変量の関係のXに指定する。",
			"x-id" =&amp;gt; "S_Explore_data_adventurously_3_Not",
			"zh-CN" =&amp;gt; "大胆地探究数据"]
		),
		Set Values(
			[59, 61, 55, 66, 52, 60, 61, 51, 60, 61, 56, 65, 63, 58, 59, 61, 62, 65,
			63, 62, 63, 64, 65, 64, 68, 64, 69, 62, 64, 67, 65, 66, 62, 66, 65, 60,
			68, 62, 68, 70]
		),
		Set Display Width( 0 )
	),
	New Column(
		["en" =&amp;gt; "weight",
		"ja" =&amp;gt; "体重(ポンド)",
		"x-id" =&amp;gt; "S_Big_Class_weight_Col",
		"zh-CN" =&amp;gt; "体重"],
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 5, 0 ),
		Set Property(
			"Notes",
			["en" =&amp;gt; "Explore data adventurously",
			"ja" =&amp;gt; "データを探索する。二変量の関係のYに指定する。",
			"x-id" =&amp;gt; "S_Explore_data_adventurously_4_Not",
			"zh-CN" =&amp;gt; "大胆地探究数据"]
		),
		Set Values(
			[95, 123, 74, 145, 64, 84, 128, 79, 112, 107, 67, 98, 105, 95, 79, 81,
			91, 142, 84, 85, 93, 99, 119, 92, 112, 99, 113, 92, 112, 128, 111, 105,
			104, 106, 112, 115, 128, 116, 134, 172]
		),
		Set Display Width( 0 )
	),
	Set Label Columns( :name )
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jul 2022 14:34:54 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521872#M74694</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-15T14:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Column Name as Variable (Very Simple)</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521898#M74695</link>
      <description>&lt;P&gt;I apologize but I do not understand how this could help me..&lt;/P&gt;&lt;P&gt;Maybe I wasn't clear in my question..&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 15:00:36 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521898#M74695</guid>
      <dc:creator>Valerio</dc:creator>
      <dc:date>2022-07-15T15:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Column Name as Variable (Very Simple)</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521909#M74698</link>
      <description>&lt;P&gt;I assumed you wanted to add a column from the update table to a new table.&amp;nbsp; I read your code, and specifically the statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Add Columns from Update Table( :Name(List[i]) )&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am not aware of a JMP statement of this name, and thought you were specifying pseudo code for the action you wanted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you need to execute this code specifically, you can expand the List reference to a literal string, and execute it&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Eval( Parse( "Add Columns from Update Table( :Name(" || List[i] || ") )" ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 15:20:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521909#M74698</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-15T15:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Column Name as Variable (Very Simple)</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521934#M74700</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My bad for not explaining properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the next level question... I think I have to combine "Parse" with "EvalExpr" but I don't know how...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( 
	i=1,
	i&amp;lt;=nitems(EPIData_to_Get),
	i++,
	Reactors_EPI &amp;lt;&amp;lt; New Column( 
		EPIData_to_Get[i], 
		Numeric, Continuous,
		Formula(
			If( :Parameter == EPIData_to_Get[i], 
				:Value
			)
		)
	);
	Eval( Parse( EvalExpr( "Column(Reactors_EPI,:Name(" || EPIData_to_Get[i] || ")) &amp;lt;&amp;lt; Set Property( "Spec Limits", {LSL(Expr(Reactors_EPI:LSL)), USL(Expr(Reactors_EPI:USL)), Show Limits(1)} ) " ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Of course, written like this does not work...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 15:56:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521934#M74700</guid>
      <dc:creator>Valerio</dc:creator>
      <dc:date>2022-07-15T15:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Column Name as Variable (Very Simple)</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521937#M74701</link>
      <description>&lt;P&gt;Try this.....you need to embed the quotes using the escape sequence&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( 
	i=1,
	i&amp;lt;=nitems(EPIData_to_Get),
	i++,
	Reactors_EPI &amp;lt;&amp;lt; New Column( 
		EPIData_to_Get[i], 
		Numeric, Continuous,
		Formula(
			If( :Parameter == EPIData_to_Get[i], 
				:Value
			)
		)
	);
	Eval( Parse( EvalExpr( "Column(Reactors_EPI,:Name(" || EPIData_to_Get[i] || 
	")) &amp;lt;&amp;lt; Set Property( \!"Spec Limits\!", {LSL(Expr(Reactors_EPI:LSL)), USL(Expr(Reactors_EPI:USL)), Show Limits(1)} ) " ) ) )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Jul 2022 16:10:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521937#M74701</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2022-07-15T16:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: Column Name as Variable (Very Simple)</title>
      <link>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521938#M74702</link>
      <description>&lt;P&gt;You are the best.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 16:22:31 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Column-Name-as-Variable-Very-Simple/m-p/521938#M74702</guid>
      <dc:creator>Valerio</dc:creator>
      <dc:date>2022-07-15T16:22:31Z</dc:date>
    </item>
  </channel>
</rss>

