<?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: loop through column names which has same string and  create subset in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53191#M30112</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;Thanks for all the Suggestions. I will keep in my mind before posting anything .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have posted my code below and it's working absolutely fine. But I need to run this code in a loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have my original data table "Sheet 1". It has 300 columns like ("Timestamp" , "donsteedOccupancy" ,&amp;nbsp; "Name( "Raeford, NC Temp" )" , "x Ahu1 y" ,&amp;nbsp;&lt;SPAN&gt;"x Ahu1 z" ,&amp;nbsp;"x Ahu1 m" ,..."x Ahu2 y" ,&amp;nbsp;"x Ahu2 z" ,&amp;nbsp;"x Ahu2 m"......."x Ahu70 y" ,&amp;nbsp;"x Ahu70 z" ,&amp;nbsp;"x Ahu70 m".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to create a subset from main datatable with first 3 columns ("Timestamp" , "donsteedOccupancy" ,&amp;nbsp; "Name( "Raeford, NC Temp" )"&amp;nbsp;) and also&amp;nbsp; &lt;STRONG&gt;all&lt;/STRONG&gt; the column names consisting &lt;STRONG&gt;"Ahu1"&lt;/STRONG&gt; to a new data table and perform various actions as i mentioned in the code.(Creating extra columns,deleting columns,Change Column properties and generating a graph).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So bascially in this code were there is "Ahu1" it has to be replaced to "Ahu[i]" and run in the loop.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to do something like this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i=0; i&amp;lt;= 52, i++
       Data Table("Sheet1") &amp;lt;&amp;lt; subset(
       Output table( "Ahu[i]"), 
        columns(Timestamp,..., "x Ahu[i] y" , "x Ahu[i] z" , "x Ahu[i] m"));
Ahu[i]_dt= Data Table("Ahu[i]");
.
.
.
Close( Ahu[i]_dt, save("Ahu[i].jmp") );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;All the fields in the code which has "Ahu1" has to be replaced to "Ahu[i]"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;original_dt = Current Data Table();

/* Sheet 1 is my original data table. I am creating a subset from original sheet which has column names as : Timestamp,donsteedOccupancy, Name( "Raeford, NC Temp" )
 and all the columns which has a string "Ahu1". I am naming this output table as Ahu1.*/

Data Table( "Sheet1" ) &amp;lt;&amp;lt; Subset(
	Output Table( "Ahu1", link to original data table( 0 ) ),
	All rows,
	columns(
		:Timestamp,
		:donSteedOccupancy,
		:Name( "Raeford, NC Temp" ),
		:DonSteedES Ahu1 ClgVlvCmd,
		:DonSteedES Ahu1 HtgVlvCmd,
		:DonSteedES Ahu1 DaT,
		:DonSteedES Ahu1 SaFanCmd,
		:DonSteedES Ahu1 ZnT,
		:DonSteedES Ahu1 ZnTStpt
	)
);

/* Assigning the output data table to "Ahu1_dt" */

Ahu1_dt = Data Table( "Ahu1" );

/* Creating new columns called "Occupancy and SafanCmd" with formula's and deleting the formula link and also the original column's  */

Ahu1_dt &amp;lt;&amp;lt; New Column( "Occupancy",
	character,
	Nominal,
	Formula( Munger( :donSteedOccupancy, Length( :donSteedOccupancy ) - 4, Length( :donSteedOccupancy ) ) )
);

Column( "Occupancy" ) &amp;lt;&amp;lt; delete formula;

Ahu1_dt &amp;lt;&amp;lt; delete columns( "donSteedOccupancy" );

Ahu1_dt &amp;lt;&amp;lt; New Column( "SaFanCmd",
	character,
	Nominal,
	Formula( Munger( :DonSteedES Ahu1 SaFanCmd, Length( :DonSteedES Ahu1 SaFanCmd ) - 4, Length( :DonSteedES Ahu1 SaFanCmd ) ) )
);

Column( "SaFanCmd" ) &amp;lt;&amp;lt; delete formula;

Ahu1_dt &amp;lt;&amp;lt; delete columns( "DonSteedES Ahu1 SaFanCmd" );

/* Using Recode to change values for columns "Occupancy and SaFanCmd " and also changing the column Data Types*/

Ahu1_dt &amp;lt;&amp;lt; Column( "Occupancy" );
	
For Each Row( :Occupancy = Match( :Occupancy, " 1min", " 1", " 0min", " 0", :Occupancy ) );
	
Column( "Occupancy" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );

Ahu1_dt &amp;lt;&amp;lt; Column( "SaFanCmd" );
	
For Each Row( :SaFanCmd = Match( :SaFanCmd, " 1min", " 1", " 0min", " 0", :SaFanCmd ) );
	
Column( "SaFanCmd" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );

/* Changing Format for the column's "DonSteedES Ahu1 ClgVlvCmd" and "Ahu1_dt:DonSteedES Ahu1 HtgVlvCmd" */

Ahu1_dt:DonSteedES Ahu1 ClgVlvCmd &amp;lt;&amp;lt; Format( "percent" );

Ahu1_dt:DonSteedES Ahu1 HtgVlvCmd &amp;lt;&amp;lt; Format( "percent" );

/* Changing Modeling type for the column : SaFanCmd */

Column( "SaFanCmd" ) &amp;lt;&amp;lt; Modeling type( continuous );

/* Generating a Graph using Graph Builder for "Ahu1_dt" and assigning it to a object called "optstartgraph" .*/

optstartgraph = Ahu1_dt &amp;lt;&amp;lt; Graph Builder(
	Size( 1377, 923 ),
	Variables(
		X( :Timestamp ),
		Y( :DonSteedES Ahu1 ClgVlvCmd ),
		Y( :DonSteedES Ahu1 HtgVlvCmd, Position( 1 ) ),
		Y( :Name( "Raeford, NC Temp" ) ),
		Y( :DonSteedES Ahu1 DaT, Position( 2 ) ),
		Y( :DonSteedES Ahu1 ZnT, Position( 2 ) ),
		Y( :DonSteedES Ahu1 ZnTStpt, Position( 2 ) ),
		Y( :SaFanCmd, Position( 2 ), Side( "Right" ) ),
		Color( :Occupancy )
	),
	Elements( Position( 1, 1 ), Line( X, Y( 1 ), Y( 2 ), Color( 0 ), Legend( 5 ) ), Heatmap( X, Legend( 8 ) ) ),
	Elements(
		Position( 1, 2 ),
		Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Color( 0 ), Legend( 6 ) ),
		Line( X, Y( 5 ), Color( 0 ), Legend( 7 ) ),
		Heatmap( X, Legend( 9 ) )
	),
	SendToReport(
		Dispatch( {"Line[DonSteedES Ahu1 ClgVlvCmd...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Heatmap[DonSteedES Ahu1 ClgVlvCmd...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Line[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Line[SaFanCmd] (right)"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Heatmap[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch(
			{},
			"Timestamp",
			ScaleBox,
			{Min( 3537633600 ), Max( 3538263600 ), Interval( "Hour" ), Inc( 1 ), Minor Ticks( 0 ), Label Row( Label Orientation( "Angled" ) )}
		),
		Dispatch( {}, "DonSteedES Ahu1 ClgVlvCmd", ScaleBox, {Min( 0 )} ),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				8,
				Properties(
					0,
					{Transparency( 0.35 ), gradient(
						{Color Theme(
							{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227, 0}, {221, 221, 0}, {238, 119, 0},
							{252, 11, 11}, {158, 33, 33}}, {0, 0.193732193732194, 0.2, 0.495726495726496, 0.501424501424502, 0.507122507122507,
							0.943019943019943, 0.95, 0.954415954415954}}
						)}
					)}
				)
			), Legend Model(
				9,
				Properties(
					0,
					{Transparency( 0.35 ), gradient(
						{Color Theme(
							{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227, 0}, {221, 221, 0}, {238, 119, 0},
							{252, 11, 11}, {158, 33, 33}}, {0, 0.193732193732194, 0.2, 0.495726495726496, 0.501424501424502, 0.507122507122507,
							0.943019943019943, 0.95, 0.954415954415954}}
						)}
					)}
				)
			)}
		),
		Dispatch(
			{},
			"400",
			LegendBox,
			{Legend Position( {5, [0, 1], 8, [2], 6, [-3, -3, 4, 5], 7, [-3], 9, [3]} ), Position( {0, 1, 2, -3, -3, 4, 5, -3, 3} )}
		)
	)
);

/*Saving the object in jpg format to a specfied file location. */

optstartgraph &amp;lt;&amp;lt; Save Picture( "C:\Projects\Projects\Hoke\Year 1\Jmp\Year 0\DonSteed\Feb16\Ahu1.jpg", "JPG" );

/* Closing the object */

optstartgraph &amp;lt;&amp;lt; close window;

/* close and save the data table "Ahu1_dt" */

Close( Ahu1_dt, save("C:\Projects\Projects\Hoke\Year 1\Jmp\Year 0\DonSteed\Feb16\Ahu1.jmp") );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Mar 2018 19:19:10 GMT</pubDate>
    <dc:creator>himajafeb8</dc:creator>
    <dc:date>2018-03-17T19:19:10Z</dc:date>
    <item>
      <title>loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53168#M30099</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a JMP table "Sheet 1" with 300 columns. I am trying to create subset for all same columns which has a string in column name as "Ahu1" and then make changes to those subset like adding the columns,updating them and generating graphs and finally saving them in a folder. I was able to write script for "Ahu1". But i have to do the same for all other "Ahu's" . I want this process to be repeated for other column names containing stings:&amp;nbsp; which are Ahu2,Ahu3,Ahu4,Ahu5,Ahu6...Ahu52. How to do this in a for loop?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Script is below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;&amp;nbsp;
original_dt = Current Data Table();
Data Table( "Sheet1" ) &amp;lt;&amp;lt; Subset(
	Output Table( "Ahu1", link to original data table( 0 ) ),
	All rows,
	columns(
		:Timestamp,
		:donSteedOccupancy,
		:Name( "Raeford, NC Temp" ),
		:DonSteedES Ahu1 ClgVlvCmd,
		:DonSteedES Ahu1 HtgVlvCmd,
		:DonSteedES Ahu1 DaT,
		:DonSteedES Ahu1 SaFanCmd,
		:DonSteedES Ahu1 ZnT,
		:DonSteedES Ahu1 ZnTStpt
	)
);
Ahu1_dt = Data Table( "Ahu1" );
Ahu1_dt &amp;lt;&amp;lt; New Column( "Occupancy",
	character,
	Nominal,
	Formula( Munger( :donSteedOccupancy, Length( :donSteedOccupancy ) - 4, Length( :donSteedOccupancy ) ) )
);
Column( "Occupancy" ) &amp;lt;&amp;lt; delete formula;
Ahu1_dt &amp;lt;&amp;lt; delete columns( "donSteedOccupancy" );
Ahu1_dt &amp;lt;&amp;lt; New Column( "SaFanCmd",
	character,
	Nominal,
	Formula(
		Munger(
			:DonSteedES Ahu1 SaFanCmd,
			Length( :DonSteedES Ahu1 SaFanCmd ) - 4,
			Length( :DonSteedES Ahu1 SaFanCmd )
		)
	)
);
Column( "SaFanCmd" ) &amp;lt;&amp;lt; delete formula;
Ahu1_dt &amp;lt;&amp;lt; delete columns( "DonSteedES Ahu1 SaFanCmd" );
Ahu1_dt &amp;lt;&amp;lt; Column( "Occupancy" );

For Each Row( :Occupancy = Match( :Occupancy, " 1min", " 1", " 0min", " 0", :Occupancy ) );

Column( "Occupancy" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );
Ahu1_dt &amp;lt;&amp;lt; Column( "SaFanCmd" );

For Each Row( :SaFanCmd = Match( :SaFanCmd, " 1min", " 1", " 0min", " 0", :SaFanCmd ) );

Column( "SaFanCmd" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );
Ahu1_dt:DonSteedES Ahu1 ClgVlvCmd &amp;lt;&amp;lt; Format( "percent" );
Ahu1_dt:DonSteedES Ahu1 HtgVlvCmd &amp;lt;&amp;lt; Format( "percent" );
Column( "SaFanCmd" ) &amp;lt;&amp;lt; Modeling type( continuous );

optstartgraph = Ahu1_dt &amp;lt;&amp;lt; Graph Builder(
	Size( 1377, 923 ),
	Variables(
		X( :Timestamp ),
		Y( :DonSteedES Ahu1 ClgVlvCmd ),
		Y( :DonSteedES Ahu1 HtgVlvCmd, Position( 1 ) ),
		Y( :Name( "Raeford, NC Temp" ) ),
		Y( :DonSteedES Ahu1 DaT, Position( 2 ) ),
		Y( :DonSteedES Ahu1 ZnT, Position( 2 ) ),
		Y( :DonSteedES Ahu1 ZnTStpt, Position( 2 ) ),
		Y( :SaFanCmd, Position( 2 ), Side( "Right" ) ),
		Color( :Occupancy )
	),
	Elements( Position( 1, 1 ), Line( X, Y( 1 ), Y( 2 ), Color( 0 ), Legend( 5 ) ), Heatmap( X, Legend( 8 ) ) ),
	Elements(
		Position( 1, 2 ),
		Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Color( 0 ), Legend( 6 ) ),
		Line( X, Y( 5 ), Color( 0 ), Legend( 7 ) ),
		Heatmap( X, Legend( 9 ) )
	),
	SendToReport(
		Dispatch( {"Line[DonSteedES Ahu1 ClgVlvCmd...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Heatmap[DonSteedES Ahu1 ClgVlvCmd...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Line[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Line[SaFanCmd] (right)"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Heatmap[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch(
			{},
			"Timestamp",
			ScaleBox,
			{Min( 3537633600 ), Max( 3538263600 ), Interval( "Hour" ), Inc( 1 ), Minor Ticks( 0 ),
			Label Row( Label Orientation( "Angled" ) )}
		),
		Dispatch( {}, "DonSteedES Ahu1 ClgVlvCmd", ScaleBox, {Min( 0 )} ),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				8,
				Properties(
					0,
					{Transparency( 0.35 ), gradient(
						{Color Theme(
							{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227,
							0}, {221, 221, 0}, {238, 119, 0}, {252, 11, 11}, {158, 33, 33}}, {0,
							0.193732193732194, 0.2, 0.495726495726496, 0.501424501424502, 0.507122507122507,
							0.943019943019943, 0.95, 0.954415954415954}}
						)}
					)}
				)
			), Legend Model(
				9,
				Properties(
					0,
					{Transparency( 0.35 ), gradient(
						{Color Theme(
							{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227,
							0}, {221, 221, 0}, {238, 119, 0}, {252, 11, 11}, {158, 33, 33}}, {0,
							0.193732193732194, 0.2, 0.495726495726496, 0.501424501424502, 0.507122507122507,
							0.943019943019943, 0.95, 0.954415954415954}}
						)}
					)}
				)
			)}
		),
		Dispatch(
			{},
			"400",
			LegendBox,
			{Legend Position( {5, [0, 1], 8, [2], 6, [-3, -3, 4, 5], 7, [-3], 9, [3]} ),
			Position( {0, 1, 2, -3, -3, 4, 5, -3, 3} )}
		)
	)
);
optstartgraph &amp;lt;&amp;lt; Save Picture( "C:\Projects\Projects\Hoke\Year 1\Jmp\Year 0\DonSteed\Feb16\Ahu1.jpg", "JPG" );
optstartgraph &amp;lt;&amp;lt; close window;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 06:13:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53168#M30099</guid>
      <dc:creator>himajafeb8</dc:creator>
      <dc:date>2018-03-15T06:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53170#M30101</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11312"&gt;@himajafeb8&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A couple of suggestions,&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. When you share code, please kindly use the "Insert JSL Script" or "Insert Code" option, so the code is formatted to enable others to easily read what you are sharing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Please break down your problem and explain which part of the code is actually giving you issues.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Going by your title, I would think doing something like the following would work. However, if you have more questions, request you to kindly break it down :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Log(); Clear Globals(); 

// Open Sample Data 
dt = Open( "$SAMPLE_DATA/Football.jmp" );

// Get Column Names 
ColNames = dt &amp;lt;&amp;lt; Get Column Names("String"); 

// Select Desired Columns 
DesTerm = "Speed";
DesCols = {}; // Initialize empty list to store selected columns 
for(i = 1 , i &amp;lt;= N Items(ColNames), i++,
	 If(Contains(ColNames[i],DesTerm),
			Insert Into(DesCols,i); 
			Col = Column(dt,i); 
			Col &amp;lt;&amp;lt; Set Selected(1);
	   );
   );

// Subset 
dt1 = dt &amp;lt;&amp;lt; Subset(Selected Rows(0),Selected Columns(1)); &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 02:16:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53170#M30101</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-15T02:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53191#M30112</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;Thanks for all the Suggestions. I will keep in my mind before posting anything .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have posted my code below and it's working absolutely fine. But I need to run this code in a loop.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have my original data table "Sheet 1". It has 300 columns like ("Timestamp" , "donsteedOccupancy" ,&amp;nbsp; "Name( "Raeford, NC Temp" )" , "x Ahu1 y" ,&amp;nbsp;&lt;SPAN&gt;"x Ahu1 z" ,&amp;nbsp;"x Ahu1 m" ,..."x Ahu2 y" ,&amp;nbsp;"x Ahu2 z" ,&amp;nbsp;"x Ahu2 m"......."x Ahu70 y" ,&amp;nbsp;"x Ahu70 z" ,&amp;nbsp;"x Ahu70 m".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to create a subset from main datatable with first 3 columns ("Timestamp" , "donsteedOccupancy" ,&amp;nbsp; "Name( "Raeford, NC Temp" )"&amp;nbsp;) and also&amp;nbsp; &lt;STRONG&gt;all&lt;/STRONG&gt; the column names consisting &lt;STRONG&gt;"Ahu1"&lt;/STRONG&gt; to a new data table and perform various actions as i mentioned in the code.(Creating extra columns,deleting columns,Change Column properties and generating a graph).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So bascially in this code were there is "Ahu1" it has to be replaced to "Ahu[i]" and run in the loop.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to do something like this.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i=0; i&amp;lt;= 52, i++
       Data Table("Sheet1") &amp;lt;&amp;lt; subset(
       Output table( "Ahu[i]"), 
        columns(Timestamp,..., "x Ahu[i] y" , "x Ahu[i] z" , "x Ahu[i] m"));
Ahu[i]_dt= Data Table("Ahu[i]");
.
.
.
Close( Ahu[i]_dt, save("Ahu[i].jmp") );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;All the fields in the code which has "Ahu1" has to be replaced to "Ahu[i]"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;original_dt = Current Data Table();

/* Sheet 1 is my original data table. I am creating a subset from original sheet which has column names as : Timestamp,donsteedOccupancy, Name( "Raeford, NC Temp" )
 and all the columns which has a string "Ahu1". I am naming this output table as Ahu1.*/

Data Table( "Sheet1" ) &amp;lt;&amp;lt; Subset(
	Output Table( "Ahu1", link to original data table( 0 ) ),
	All rows,
	columns(
		:Timestamp,
		:donSteedOccupancy,
		:Name( "Raeford, NC Temp" ),
		:DonSteedES Ahu1 ClgVlvCmd,
		:DonSteedES Ahu1 HtgVlvCmd,
		:DonSteedES Ahu1 DaT,
		:DonSteedES Ahu1 SaFanCmd,
		:DonSteedES Ahu1 ZnT,
		:DonSteedES Ahu1 ZnTStpt
	)
);

/* Assigning the output data table to "Ahu1_dt" */

Ahu1_dt = Data Table( "Ahu1" );

/* Creating new columns called "Occupancy and SafanCmd" with formula's and deleting the formula link and also the original column's  */

Ahu1_dt &amp;lt;&amp;lt; New Column( "Occupancy",
	character,
	Nominal,
	Formula( Munger( :donSteedOccupancy, Length( :donSteedOccupancy ) - 4, Length( :donSteedOccupancy ) ) )
);

Column( "Occupancy" ) &amp;lt;&amp;lt; delete formula;

Ahu1_dt &amp;lt;&amp;lt; delete columns( "donSteedOccupancy" );

Ahu1_dt &amp;lt;&amp;lt; New Column( "SaFanCmd",
	character,
	Nominal,
	Formula( Munger( :DonSteedES Ahu1 SaFanCmd, Length( :DonSteedES Ahu1 SaFanCmd ) - 4, Length( :DonSteedES Ahu1 SaFanCmd ) ) )
);

Column( "SaFanCmd" ) &amp;lt;&amp;lt; delete formula;

Ahu1_dt &amp;lt;&amp;lt; delete columns( "DonSteedES Ahu1 SaFanCmd" );

/* Using Recode to change values for columns "Occupancy and SaFanCmd " and also changing the column Data Types*/

Ahu1_dt &amp;lt;&amp;lt; Column( "Occupancy" );
	
For Each Row( :Occupancy = Match( :Occupancy, " 1min", " 1", " 0min", " 0", :Occupancy ) );
	
Column( "Occupancy" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );

Ahu1_dt &amp;lt;&amp;lt; Column( "SaFanCmd" );
	
For Each Row( :SaFanCmd = Match( :SaFanCmd, " 1min", " 1", " 0min", " 0", :SaFanCmd ) );
	
Column( "SaFanCmd" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );

/* Changing Format for the column's "DonSteedES Ahu1 ClgVlvCmd" and "Ahu1_dt:DonSteedES Ahu1 HtgVlvCmd" */

Ahu1_dt:DonSteedES Ahu1 ClgVlvCmd &amp;lt;&amp;lt; Format( "percent" );

Ahu1_dt:DonSteedES Ahu1 HtgVlvCmd &amp;lt;&amp;lt; Format( "percent" );

/* Changing Modeling type for the column : SaFanCmd */

Column( "SaFanCmd" ) &amp;lt;&amp;lt; Modeling type( continuous );

/* Generating a Graph using Graph Builder for "Ahu1_dt" and assigning it to a object called "optstartgraph" .*/

optstartgraph = Ahu1_dt &amp;lt;&amp;lt; Graph Builder(
	Size( 1377, 923 ),
	Variables(
		X( :Timestamp ),
		Y( :DonSteedES Ahu1 ClgVlvCmd ),
		Y( :DonSteedES Ahu1 HtgVlvCmd, Position( 1 ) ),
		Y( :Name( "Raeford, NC Temp" ) ),
		Y( :DonSteedES Ahu1 DaT, Position( 2 ) ),
		Y( :DonSteedES Ahu1 ZnT, Position( 2 ) ),
		Y( :DonSteedES Ahu1 ZnTStpt, Position( 2 ) ),
		Y( :SaFanCmd, Position( 2 ), Side( "Right" ) ),
		Color( :Occupancy )
	),
	Elements( Position( 1, 1 ), Line( X, Y( 1 ), Y( 2 ), Color( 0 ), Legend( 5 ) ), Heatmap( X, Legend( 8 ) ) ),
	Elements(
		Position( 1, 2 ),
		Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Color( 0 ), Legend( 6 ) ),
		Line( X, Y( 5 ), Color( 0 ), Legend( 7 ) ),
		Heatmap( X, Legend( 9 ) )
	),
	SendToReport(
		Dispatch( {"Line[DonSteedES Ahu1 ClgVlvCmd...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Heatmap[DonSteedES Ahu1 ClgVlvCmd...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Line[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Line[SaFanCmd] (right)"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch( {"Heatmap[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
		Dispatch(
			{},
			"Timestamp",
			ScaleBox,
			{Min( 3537633600 ), Max( 3538263600 ), Interval( "Hour" ), Inc( 1 ), Minor Ticks( 0 ), Label Row( Label Orientation( "Angled" ) )}
		),
		Dispatch( {}, "DonSteedES Ahu1 ClgVlvCmd", ScaleBox, {Min( 0 )} ),
		Dispatch(
			{},
			"400",
			ScaleBox,
			{Legend Model(
				8,
				Properties(
					0,
					{Transparency( 0.35 ), gradient(
						{Color Theme(
							{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227, 0}, {221, 221, 0}, {238, 119, 0},
							{252, 11, 11}, {158, 33, 33}}, {0, 0.193732193732194, 0.2, 0.495726495726496, 0.501424501424502, 0.507122507122507,
							0.943019943019943, 0.95, 0.954415954415954}}
						)}
					)}
				)
			), Legend Model(
				9,
				Properties(
					0,
					{Transparency( 0.35 ), gradient(
						{Color Theme(
							{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227, 0}, {221, 221, 0}, {238, 119, 0},
							{252, 11, 11}, {158, 33, 33}}, {0, 0.193732193732194, 0.2, 0.495726495726496, 0.501424501424502, 0.507122507122507,
							0.943019943019943, 0.95, 0.954415954415954}}
						)}
					)}
				)
			)}
		),
		Dispatch(
			{},
			"400",
			LegendBox,
			{Legend Position( {5, [0, 1], 8, [2], 6, [-3, -3, 4, 5], 7, [-3], 9, [3]} ), Position( {0, 1, 2, -3, -3, 4, 5, -3, 3} )}
		)
	)
);

/*Saving the object in jpg format to a specfied file location. */

optstartgraph &amp;lt;&amp;lt; Save Picture( "C:\Projects\Projects\Hoke\Year 1\Jmp\Year 0\DonSteed\Feb16\Ahu1.jpg", "JPG" );

/* Closing the object */

optstartgraph &amp;lt;&amp;lt; close window;

/* close and save the data table "Ahu1_dt" */

Close( Ahu1_dt, save("C:\Projects\Projects\Hoke\Year 1\Jmp\Year 0\DonSteed\Feb16\Ahu1.jmp") );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2018 19:19:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53191#M30112</guid>
      <dc:creator>himajafeb8</dc:creator>
      <dc:date>2018-03-17T19:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53194#M30114</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11312"&gt;@himajafeb8&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp;Can you share a sample of your data ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 13:58:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53194#M30114</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-15T13:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53195#M30115</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&lt;/P&gt;&lt;P&gt;I have attached the sample data.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:04:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53195#M30115</guid>
      <dc:creator>himajafeb8</dc:creator>
      <dc:date>2018-03-15T14:04:37Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53196#M30116</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11312"&gt;@himajafeb8&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If you were to try something like this - essentially use regular expressions to try and match Ahu on a loop every single time but edit the conditions to increment from 1 - n, I would think it would work. I dont have a working example. I will try a little more on the regex front&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt_Raw = Current Data Table(); &lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;ColNames = dt_Raw &amp;lt;&amp;lt; Get Column Names("String"); 
RegexToMatch = "^(a|A)hu[0-9]$";

for(i = 1 , i &amp;lt;= N Items(ColNames), i++,
		If(!IsMissing(Regex(Char(ColNames[i]),RegexToMatch)),
			Col = Column(dt_Raw,i);
			Col &amp;lt;&amp;lt; Set Selected(1); 
		  );
   );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Mar 2018 14:31:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53196#M30116</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-15T14:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53285#M30165</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thats not working. You have any other way to do it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 15:25:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53285#M30165</guid>
      <dc:creator>himajafeb8</dc:creator>
      <dc:date>2018-03-16T15:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53308#M30178</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/11312"&gt;@himajafeb8&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; At this point, I couldn't get it to work. I would contact support@jmp.com .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Mar 2018 19:26:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53308#M30178</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-03-16T19:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53327#M30188</link>
      <description>&lt;P&gt;Here is a version of your code that will loop across all 50 of your Ahu column sets.&amp;nbsp; See the comments in the script as to what was done to make the looping possible&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
original_dt = Data Table( "Sheet1" );

// Loop across all 50 Ahu column sets
// The number of column sets could be programatically determined
// if desired
For( i = 1, i &amp;lt;= 50, i++,

	// Set the Ahu version to be used
	targetAhu = "Ahu" || Char( i );
	
	// Create the subsetted data table, naming it by the 
	// name of the current Ahu version
	Ahu_dt = original_dt &amp;lt;&amp;lt; Subset(
		Output Table( targetAhu, link to original data table( 0 ) ),
		All rows,
		columns(
			original_dt:Timestamp,
			original_dt:donSteedOccupancy,
			original_dt:Name( "Raeford, NC Temp" ),
			Column( original_dt, "DonSteedES " || targetAhu || " ClgVlvCmd" ),
			Column( original_dt, "DonSteedES " || targetAhu || " HtgVlvCmd" ),
			Column( original_dt, "DonSteedES " || targetAhu || " DaT" ),
			Column( original_dt, "DonSteedES " || targetAhu || " SaFanCmd" ),
			Column( original_dt, "DonSteedES " || targetAhu || " ZnT" ),
			Column( original_dt, "DonSteedES " || targetAhu || " ZnTStpt" )
		)
	);
	
	// no need for this statement, since it is set when the data table is created
	//Ahu_dt = Data Table( targetAhu );
	
	// No changes needed here, except for pointing to the current Ahu data table
	Ahu_dt &amp;lt;&amp;lt; New Column( "Occupancy",
		character,
		Nominal,
		Formula( Munger( :donSteedOccupancy, Length( :donSteedOccupancy ) - 4, Length( :donSteedOccupancy ) ) )
	);
	Column( Ahu_dt, "Occupancy" ) &amp;lt;&amp;lt; delete formula;
	Ahu_dt &amp;lt;&amp;lt; delete columns( "donSteedOccupancy" );

	// This section of code has required changes embedded within a formula
	// JMP will not resolve the code properly and therefore, Substitution
	// is required to force the generation of the exact code required for
	// the formula
	Eval(
		Substitute(
				Expr(
					Ahu_dt &amp;lt;&amp;lt; New Column( "SaFanCmd",
						character,
						Nominal,
						Formula( Munger( __SaFanCmd__, Length( __SaFanCmd__ ) - 4, Length( __SaFanCmd__ ) ) )
					)
				),
			Expr( __SaFanCmd__ ), Parse( ":DonSteedES " || targetAhu || " SaFanCmd" )
		)
	);
	Column( Ahu_dt, "SaFanCmd" ) &amp;lt;&amp;lt; delete formula;

	// Minor changes, just making sure the current target data table is being
	// pointed to
	Ahu_dt &amp;lt;&amp;lt; delete columns( "DonSteedES " || targetAhu || " SaFanCmd" );
	Ahu_dt &amp;lt;&amp;lt; Column( "Occupancy" );

	For Each Row( ahu_dt:Occupancy = Match( Ahu_dt:Occupancy, " 1min", " 1", " 0min", " 0", Ahu_dt:Occupancy ) );

	// I don't understand this next line of code....changing to character and then changing to numeric
	// unless you are using JMP to get rid of non numeric data
	Column( ahu_dt, "Occupancy" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );
	Ahu_dt &amp;lt;&amp;lt; Column( "SaFanCmd" );

	For Each Row( ahu_dt:SaFanCmd = Match( ahu_dt:SaFanCmd, " 1min", " 1", " 0min", " 0", ahu_dt:SaFanCmd ) );

	Column( ahu_dt, "SaFanCmd" ) &amp;lt;&amp;lt; Data type( character ) &amp;lt;&amp;lt; Set Data Type( Numeric );

	Column( Ahu_dt, "DonSteedES " || targetAhu || " ClgVlvCmd" ) &amp;lt;&amp;lt; Format( "percent" );
	Column( Ahu_dt, "DonSteedES " || targetAhu || " HtgVlvCmd" ) &amp;lt;&amp;lt; Format( "percent" );
	Column( Ahu_dt, "SaFanCmd" ) &amp;lt;&amp;lt; Modeling type( continuous );

	// The Graph Builder Platform has a few places where code will not be resolved, and therefore
	// once again Substitution() is what is needed to make it work
	Eval(
		Substitute(
				Expr(
					optstartgraph = Ahu_dt &amp;lt;&amp;lt; Graph Builder(
						Size( 1377, 923 ),
						Variables(
							X( :Timestamp ),
							Y( Column( Ahu_dt, "DonSteedES " || targetAhu || " ClgVlvCmd" ) ),
							Y( Column( Ahu_dt, "DonSteedES " || targetAhu || " HtgVlvCmd" ), Position( 1 ) ),
							Y( :Name( "Raeford, NC Temp" ) ),
							Y( Column( Ahu_dt, "DonSteedES " || targetAhu || " DaT" ), Position( 2 ) ),
							Y( Column( Ahu_dt, "DonSteedES " || targetAhu || " ZnT" ), Position( 2 ) ),
							Y( Column( Ahu_dt, "DonSteedES " || targetAhu || " ZnTStpt" ), Position( 2 ) ),
							Y( :SaFanCmd, Position( 2 ), Side( "Right" ) ),
							Color( :Occupancy )
						),
						Elements( Position( 1, 1 ), Line( X, Y( 1 ), Y( 2 ), Color( 0 ), Legend( 5 ) ), Heatmap( X, Legend( 8 ) ) ),
						Elements(
							Position( 1, 2 ),
							Line( X, Y( 1 ), Y( 2 ), Y( 3 ), Y( 4 ), Color( 0 ), Legend( 6 ) ),
							Line( X, Y( 5 ), Color( 0 ), Legend( 7 ) ),
							Heatmap( X, Legend( 9 ) )
						),
						SendToReport(
							Dispatch( {__LineClgVlvCmd__}, "", OutlineBox, {Close( 0 )} ),
							Dispatch( {__HeatmapClgVlvCmd__}, "", OutlineBox, {Close( 0 )} ),
							Dispatch( {"Line[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
							Dispatch( {"Line[SaFanCmd] (right)"}, "", OutlineBox, {Close( 0 )} ),
							Dispatch( {"Heatmap[Raeford, NC Temp...]"}, "", OutlineBox, {Close( 0 )} ),
							Dispatch(
								{},
								"Timestamp",
								ScaleBox,
								{Min( 3537633600 ), Max( 3538263600 ), Interval( "Hour" ), Inc( 1 ), Minor Ticks( 0 ),
								Label Row( Label Orientation( "Angled" ) )}
							),
							Dispatch( {}, "DonSteedES " || targetAhu || " ClgVlvCmd", ScaleBox, {Min( 0 )} ),
							Dispatch(
								{},
								"400",
								ScaleBox,
								{Legend Model(
									8,
									Properties(
										0,
										{Transparency( 0.35 ), gradient(
											{Color Theme(
												{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227, 0}, {221, 221, 0
												}, {238, 119, 0}, {252, 11, 11}, {158, 33, 33}}, {0, 0.193732193732194, 0.2, 0.495726495726496,
												0.501424501424502, 0.507122507122507, 0.943019943019943, 0.95, 0.954415954415954}}
											)}
										)}
									)
								), Legend Model(
									9,
									Properties(
										0,
										{Transparency( 0.35 ), gradient(
											{Color Theme(
												{"mine", 16387, {{79, 16, 79}, {119, 0, 119}, {42, 63, 255}, {0, 170, 170}, {0, 227, 0}, {221, 221, 0
												}, {238, 119, 0}, {252, 11, 11}, {158, 33, 33}}, {0, 0.193732193732194, 0.2, 0.495726495726496,
												0.501424501424502, 0.507122507122507, 0.943019943019943, 0.95, 0.954415954415954}}
											)}
										)}
									)
								)}
							),
							Dispatch(
								{},
								"400",
								LegendBox,
								{Legend Position( {5, [0, 1], 8, [2], 6, [-3, -3, 4, 5], 7, [-3], 9, [3]} ), Position(
									{0, 1, 2, -3, -3, 4, 5, -3, 3}
								)}
							)
						)
					)
				),
			Expr( __LineClgVlvCmd__ ), "Line[DonSteedES " || targetAhu || " ClgVlvCmd...]",
			Expr( __HeatmapClgVlvCmd__ ), "Heatmap[DonSteedES " || targetAhu || " ClgVlvCmd...]"
		)
	);
	
	// Save the current graphic, replacing the jpg name with the current target Ahu version
	optstartgraph &amp;lt;&amp;lt; Save Picture( "C:\Projects\Projects\Hoke\Year 1\Jmp\Year 0\DonSteed\Feb16\" || targetAhu || ".jpg", "JPG" );
	optstartgraph &amp;lt;&amp;lt; close window;
	// You can also close the current target data table if you want
	close( dt_Ahu, no save );
); // End of For Loop&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Mar 2018 12:55:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53327#M30188</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2018-03-17T12:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: loop through column names which has same string and  create subset</title>
      <link>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53358#M30206</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;Thank you so much . :)&lt;/img&gt; it's working!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6696"&gt;@uday_guntupalli&lt;/a&gt;&amp;nbsp;Appreciate your help too! :)&lt;/img&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 01:50:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/loop-through-column-names-which-has-same-string-and-create/m-p/53358#M30206</guid>
      <dc:creator>himajafeb8</dc:creator>
      <dc:date>2018-03-19T01:50:37Z</dc:date>
    </item>
  </channel>
</rss>

