<?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: graphically compare data results in datafolders in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379692#M62968</link>
    <description>&lt;P&gt;I had to guess at a few things, but the script below creates a separate pdf for each of the files found in the datatable folders.&amp;nbsp; I modified the graph format a bit.&amp;nbsp; It shows all of the same information, as I can best determine, but in a slightly different form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the script, you will need to put in the paths to folder 1 and folder 2.&amp;nbsp; Currently, the pdf's are being save in the $TEMP directory.&amp;nbsp; You will need to change them to a real folder.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Set folder1 and folder2 paths

folder1 = "path to folder 1";
folder2 = "path to folder 2";

// Get files in datafolder 1 folder
fileNamesList = Files In Directory( folder1 );

For( File = 1, File &amp;lt;= N Items( fileNamesList ), File++, 

// Open the file in datafolder1
	dt1 = Open(
		folder1 || "/" || fileNamesList[File],
		Import Settings(
			End Of Line( CRLF, CR, LF ),
			End Of Field( Tab, Comma, CSV( 1 ) ),
			Strip Quotes( 1 ),
			Use Apostrophe as Quotation Mark( 0 ),
			Use Regional Settings( 0 ),
			Scan Whole File( 1 ),
			Treat empty columns as numeric( 0 ),
			CompressNumericColumns( 0 ),
			CompressCharacterColumns( 0 ),
			CompressAllowListCheck( 0 ),
			Labels( 1 ),
			Column Names Start( 1 ),
			Data Starts( 2 ),
			Lines To Read( "All" ),
			Year Rule( "20xx" )
		)
	);

// New column: Index
	dt1 &amp;lt;&amp;lt; New Column( "Index", Numeric, "ordinal", Format( "Best", 12 ), Set Each Value( Row() ) );

// New column: Index
	dt1 &amp;lt;&amp;lt; New Column( "Measured", Character, Set Each Value( "Before" ) );

// Open the file in datafolder2
	dt2 = Open(
		folder1 || "/" || fileNamesList[File], 
		Import Settings(
			End Of Line( CRLF, CR, LF ),
			End Of Field( Tab, Comma, CSV( 1 ) ),
			Strip Quotes( 1 ),
			Use Apostrophe as Quotation Mark( 0 ),
			Use Regional Settings( 0 ),
			Scan Whole File( 1 ),
			Treat empty columns as numeric( 0 ),
			CompressNumericColumns( 0 ),
			CompressCharacterColumns( 0 ),
			CompressAllowListCheck( 0 ),
			Labels( 1 ),
			Column Names Start( 1 ),
			Data Starts( 2 ),
			Lines To Read( "All" ),
			Year Rule( "20xx" )
		)
	);

// New column: Index
	dt2 &amp;lt;&amp;lt; New Column( "Index", Numeric, "Ordinal", Format( "Best", 12 ), Set Each Value( Row() ) );

// New column: Index
	dt2 &amp;lt;&amp;lt; New Column( "Measured", Character, Set Each Value( "After" ) );

	// Concatenate tables
	// → Data Table( "HW.DiodeTest.ADP_diodes" )
	dt1 &amp;lt;&amp;lt; Concatenate( dt2, Append to first table );

	// Close the After data table
	Close( dt2, nosave );

	// get all continuous columns in the data table
	colNamesList = dt1 &amp;lt;&amp;lt; get column names( continuous, string );

	theJournal = New Window( fileNamesList[File], &amp;lt;&amp;lt;journal );
	theJournal &amp;lt;&amp;lt; show window(0);

	// Loop through all of the columns
	For( graph = 1, graph &amp;lt;= N Items( colNamesList ), graph++,
		gb = Graph Builder(
			Size( 531, 308 ),
			Show Control Panel( 0 ),
			Variables( X( :Index ), Y( As Column( colNamesList[graph] ) ), Overlay( :Measured ) ),
			Elements( Line( X, Y, Legend( 14 ) ) ),
			SendToReport(
				Dispatch(
					{},
					"Index",
					ScaleBox,
					{Min( -0.5 ), Max( 47.513842007589 ), Inc( 10 ), Minor Ticks( 0 )}
				),
				Dispatch(
					{},
					"400",
					ScaleBox,
					{Legend Model(
						14,
						Properties( 0, {Line Width( 4 )}, Item ID( "After", 1 ) ),
						Properties( 1, {Line Width( 4 )}, Item ID( "Before", 1 ) )
					)}
				),
				Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),
				Dispatch( {}, "400", LegendBox, {Sides( "Top" )} )
			)
		);
		Report( gb )[Outline Box( 1 )] &amp;lt;&amp;lt; set title( colNamesList[graph] );

		theJournal &amp;lt;&amp;lt; append( Report( gb ) );
		gb &amp;lt;&amp;lt; close window;	
	
	);
	
	// Save the journal
	theJournal &amp;lt;&amp;lt; save pdf( "$TEMP/" || fileNamesList[File] || ".pdf", portrait( 1 ) );
	
	// Close the journal
	theJournal &amp;lt;&amp;lt; close window;
	
	// clean up the workspace by closing the current data table
	Close( dt1, nosave );
);

open("$TEMP/" ||fileNamesList[2]||".pdf")


	







&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 05:04:56 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2021-04-27T05:04:56Z</dc:date>
    <item>
      <title>graphically compare data results in datafolders</title>
      <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379645#M62962</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am fairly new to JMP and looking to do following, quite challenging operation automatically, preferably via automated JMP script or any other solution you experts may recommend :).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My data:&lt;/P&gt;
&lt;P&gt;I have two folders of results, datafolder1 and datafolder2. They are technically the same measurements, there is a minor difference done the the setup and same measurements are repeated after and before the change.&lt;/P&gt;
&lt;P&gt;Each folder has multiple .txt files that are the result files in .txt table format. The .txt files have same names for each folder, and the column names are the same. In practice, only the numeric data is slightly different for each file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What i want:&lt;/P&gt;
&lt;P&gt;I want to graphically compare difference of result datafolder1 vs result datafolder2 for each column in with same name of .txt and generate .pdf output of the results. I managed to generate the output that i wanted in .pdf format, but had to 8-12 hours of manual work to get that output with graph builder. The output file is called "wanted_output.pdf". Now i got many other similar cases to do, and doing this by manual would take many months to do.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;the data files are as attachment. [data has since been removed]&lt;/P&gt;
&lt;P&gt;Thank you in advance, been stuggling with this issue for months, and I hope JMP has simple solution for this!&lt;/P&gt;</description>
      <pubDate>Sun, 11 Jun 2023 11:13:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379645#M62962</guid>
      <dc:creator>PerttiPasanen</dc:creator>
      <dc:date>2023-06-11T11:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: graphically compare data results in datafolders</title>
      <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379664#M62963</link>
      <description>&lt;P&gt;File / Import Multiple Files could get you started fairly easily. You will have to do some changes to default settings when importing the files (change separator from comma to tab).&lt;/P&gt;&lt;P&gt;From this point you can start joining the datatables. I'm not sure if there is any easy way to do this except for JSL and looping over the list of datatables you just got from previous step.&lt;/P&gt;&lt;P&gt;Repeat this process for both folders and then concatenate datatables together and finally create graph with graph builder (you might need to stack the data before creating graph).&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 08:37:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379664#M62963</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-04-26T08:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: graphically compare data results in datafolders</title>
      <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379671#M62965</link>
      <description>&lt;P&gt;Thank you Jarmo for quick reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I indeed need an JSL to do this all, its too time consuming to do this for multiple other cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In architectural view, following JSL could workout:&lt;/P&gt;&lt;P&gt;1.Import all the files from both folder.&lt;/P&gt;&lt;P&gt;2. Join/&amp;amp;&lt;SPAN&gt;concatenate results into one file, JMP seems to automatically add some kind of indexing when table name is the same (of XXXX).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3. Sort the column&amp;nbsp;names in alphabetical order.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4. plot column 1&amp;amp;2 into one plot, plot column 3&amp;amp;4 for next plot, plot column 5&amp;amp;6 for next plot... repeat plotting following numbers until there are no columns left.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It all sounds easy, but I have only beginner understanding of JSL, any tips and examples for each steps?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 09:55:18 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379671#M62965</guid>
      <dc:creator>PerttiPasanen</dc:creator>
      <dc:date>2021-04-26T09:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: graphically compare data results in datafolders</title>
      <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379672#M62966</link>
      <description>&lt;P&gt;Could you send me a private message in JMP Community? I can help maybe a bit easier through email and then we can possibly post the final solution here.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 10:03:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379672#M62966</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2021-04-26T10:03:58Z</dc:date>
    </item>
    <item>
      <title>Re: graphically compare data results in datafolders</title>
      <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379692#M62968</link>
      <description>&lt;P&gt;I had to guess at a few things, but the script below creates a separate pdf for each of the files found in the datatable folders.&amp;nbsp; I modified the graph format a bit.&amp;nbsp; It shows all of the same information, as I can best determine, but in a slightly different form.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the script, you will need to put in the paths to folder 1 and folder 2.&amp;nbsp; Currently, the pdf's are being save in the $TEMP directory.&amp;nbsp; You will need to change them to a real folder.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );

// Set folder1 and folder2 paths

folder1 = "path to folder 1";
folder2 = "path to folder 2";

// Get files in datafolder 1 folder
fileNamesList = Files In Directory( folder1 );

For( File = 1, File &amp;lt;= N Items( fileNamesList ), File++, 

// Open the file in datafolder1
	dt1 = Open(
		folder1 || "/" || fileNamesList[File],
		Import Settings(
			End Of Line( CRLF, CR, LF ),
			End Of Field( Tab, Comma, CSV( 1 ) ),
			Strip Quotes( 1 ),
			Use Apostrophe as Quotation Mark( 0 ),
			Use Regional Settings( 0 ),
			Scan Whole File( 1 ),
			Treat empty columns as numeric( 0 ),
			CompressNumericColumns( 0 ),
			CompressCharacterColumns( 0 ),
			CompressAllowListCheck( 0 ),
			Labels( 1 ),
			Column Names Start( 1 ),
			Data Starts( 2 ),
			Lines To Read( "All" ),
			Year Rule( "20xx" )
		)
	);

// New column: Index
	dt1 &amp;lt;&amp;lt; New Column( "Index", Numeric, "ordinal", Format( "Best", 12 ), Set Each Value( Row() ) );

// New column: Index
	dt1 &amp;lt;&amp;lt; New Column( "Measured", Character, Set Each Value( "Before" ) );

// Open the file in datafolder2
	dt2 = Open(
		folder1 || "/" || fileNamesList[File], 
		Import Settings(
			End Of Line( CRLF, CR, LF ),
			End Of Field( Tab, Comma, CSV( 1 ) ),
			Strip Quotes( 1 ),
			Use Apostrophe as Quotation Mark( 0 ),
			Use Regional Settings( 0 ),
			Scan Whole File( 1 ),
			Treat empty columns as numeric( 0 ),
			CompressNumericColumns( 0 ),
			CompressCharacterColumns( 0 ),
			CompressAllowListCheck( 0 ),
			Labels( 1 ),
			Column Names Start( 1 ),
			Data Starts( 2 ),
			Lines To Read( "All" ),
			Year Rule( "20xx" )
		)
	);

// New column: Index
	dt2 &amp;lt;&amp;lt; New Column( "Index", Numeric, "Ordinal", Format( "Best", 12 ), Set Each Value( Row() ) );

// New column: Index
	dt2 &amp;lt;&amp;lt; New Column( "Measured", Character, Set Each Value( "After" ) );

	// Concatenate tables
	// → Data Table( "HW.DiodeTest.ADP_diodes" )
	dt1 &amp;lt;&amp;lt; Concatenate( dt2, Append to first table );

	// Close the After data table
	Close( dt2, nosave );

	// get all continuous columns in the data table
	colNamesList = dt1 &amp;lt;&amp;lt; get column names( continuous, string );

	theJournal = New Window( fileNamesList[File], &amp;lt;&amp;lt;journal );
	theJournal &amp;lt;&amp;lt; show window(0);

	// Loop through all of the columns
	For( graph = 1, graph &amp;lt;= N Items( colNamesList ), graph++,
		gb = Graph Builder(
			Size( 531, 308 ),
			Show Control Panel( 0 ),
			Variables( X( :Index ), Y( As Column( colNamesList[graph] ) ), Overlay( :Measured ) ),
			Elements( Line( X, Y, Legend( 14 ) ) ),
			SendToReport(
				Dispatch(
					{},
					"Index",
					ScaleBox,
					{Min( -0.5 ), Max( 47.513842007589 ), Inc( 10 ), Minor Ticks( 0 )}
				),
				Dispatch(
					{},
					"400",
					ScaleBox,
					{Legend Model(
						14,
						Properties( 0, {Line Width( 4 )}, Item ID( "After", 1 ) ),
						Properties( 1, {Line Width( 4 )}, Item ID( "Before", 1 ) )
					)}
				),
				Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} ),
				Dispatch( {}, "400", LegendBox, {Sides( "Top" )} )
			)
		);
		Report( gb )[Outline Box( 1 )] &amp;lt;&amp;lt; set title( colNamesList[graph] );

		theJournal &amp;lt;&amp;lt; append( Report( gb ) );
		gb &amp;lt;&amp;lt; close window;	
	
	);
	
	// Save the journal
	theJournal &amp;lt;&amp;lt; save pdf( "$TEMP/" || fileNamesList[File] || ".pdf", portrait( 1 ) );
	
	// Close the journal
	theJournal &amp;lt;&amp;lt; close window;
	
	// clean up the workspace by closing the current data table
	Close( dt1, nosave );
);

open("$TEMP/" ||fileNamesList[2]||".pdf")


	







&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 05:04:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379692#M62968</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2021-04-27T05:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: graphically compare data results in datafolders</title>
      <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379710#M62969</link>
      <description>&lt;P&gt;And, as an alternative to &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;'s approach, and following the original idea (and using the 'Include Subfolders' option):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

// Unzip the example file 'net_data.zip' to your Desktop

// Generated via 'File &amp;gt; Open Multiple..': tabList is a list of 'paired' tables
// that are built automatically according to the commonality of column names 
tabList = 
Multiple File Import(
	&amp;lt;&amp;lt;Set Folder( "$DESKTOP/net_data/" ),
	&amp;lt;&amp;lt;Set Show Hidden( 0 ),
	&amp;lt;&amp;lt;Set Subfolders( 1 ),
	&amp;lt;&amp;lt;Set Name Filter( "*.txt;" ),
	&amp;lt;&amp;lt;Set Name Enable( 1 ),
	&amp;lt;&amp;lt;Set Add File Name Column( 1 ),
	&amp;lt;&amp;lt;Set Import Mode( "CSVData" ),
	&amp;lt;&amp;lt;Set Charset( "Best Guess" ),
	&amp;lt;&amp;lt;Set Stack Mode( "Stack Similar" ),
	&amp;lt;&amp;lt;Set CSV Has Headers( 1 ),
	&amp;lt;&amp;lt;Set CSV Allow Numeric( 1 ),
	&amp;lt;&amp;lt;Set CSV First Header Line( 1 ),
	&amp;lt;&amp;lt;Set CSV Number Of Header Lines( 1 ),
	&amp;lt;&amp;lt;Set CSV First Data Line( 2 ),
	&amp;lt;&amp;lt;Set CSV EOF Comma( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Tab( 1 ),
	&amp;lt;&amp;lt;Set CSV EOF Space( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Spaces( 0 ),
	&amp;lt;&amp;lt;Set CSV EOF Other( "" ),
	&amp;lt;&amp;lt;Set CSV EOL CRLF( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL CR( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL LF( 1 ),
	&amp;lt;&amp;lt;Set CSV EOL Semicolon( 0 ),
	&amp;lt;&amp;lt;Set CSV EOL Other( "" ),
	&amp;lt;&amp;lt;Set CSV Quote( "\!"" ),
	&amp;lt;&amp;lt;Set CSV Escape( "" )
) &amp;lt;&amp;lt; Import Data;

// Loop over each table, and add a sequential 'ID' column, grouped by the originating file
// WARNING: You may need more error checking!
 for (t=1, t&amp;lt;=NItems(tabList), t++,
 	dt = tabList[t];
 	nUnits = NRow(dt)/2;
 	ids = Repeat(Transpose(1::nUnits), 2);
 	dt &amp;lt;&amp;lt; NewColumn("ID", Numeric, Continuous, SetValues(ids));
	);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As usual, the integrity of the final results depends on what you can (and can't) assume about the regularity of the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 12:43:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379710#M62969</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2021-04-26T12:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: graphically compare data results in datafolders</title>
      <link>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379780#M62974</link>
      <description>&lt;P&gt;Hi txnelson and Ian&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works like a charm! Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to change datafolder2 variable from folder1 to folder2.&lt;/P&gt;&lt;P&gt;Also for some reason .pdf printing didnt scale well, I had to change default printing settings File=&amp;gt;Page setup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem solved, thanks for everybody help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. I had to remove data from first post, but technically any before and after type of data folders works with this script.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2021 15:11:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/graphically-compare-data-results-in-datafolders/m-p/379780#M62974</guid>
      <dc:creator>PerttiPasanen</dc:creator>
      <dc:date>2021-04-26T15:11:16Z</dc:date>
    </item>
  </channel>
</rss>

