JMP 데이터 테이블 업데이트<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />일주일에 2~3회 JMP 데이터 테이블을 업데이트하는 데 사용하는 Excel 테이블이 있습니다.그러나 Excel 파일을 검색한 후 테이블 플랫폼을 사용하여 업데이트를 수행하면 소스 스크립트가 변경됩니다.소스 스크립트는 테이블 업데이트 플랫폼에서 수행되는 단계로 변경됩니다.왜 이런 일이 발생합니까?한 단계가 누락되었나요?
Re: JMP 데이터 테이블 업데이트목록에서 스크립트 이름을 가져오는 프로세스를 자동화하는 루프의 문제를 파악했으며 이제 업데이트된 테이블을 동적으로 생성하고 원본 테이블에 포함된 모든 스크립트를 새 테이블로 이동합니다.
최종 버전에 대해 설명했으며 다른 사람이 이 솔루션을 사용해야 하는 경우 아래에 포함했습니다.
모든 도움에 감사드립니다.
데이브
//
// The purpose of this script is to create an updated JMP data table based on the same source
// data file used to create the JMP data table currently open.
//
// This script is used when you have created a JMP data table from a source data file that is
// updated over time and will continue to "grow" with new data as time progresses. Examples of
// this type of file is a monthly time accounting record or a periodic production report.
//
// This script is focused on source data that is "added to" as time progresses and is not intended
// for source data that contains only data for the given period with no historical data retained.
//
// The script utilzes the original "Open" command found within the "Source" script of the JMP data table
// and then copies over all of the scripts from the original data table into the new "updated" data table.
dtCurrent = Current Data Table();
// copy the Open command from the "Source" script of the main data table
// this is only required once as long as the name and location of the source data file remains unchanged
dtUpdate = Open(
"Z:\JMP Data Analysis\SLOC Metrics\Data Update Testing\Project_Metrics.xlsx",
Worksheets( "Code_Change_Metrics" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 1 ),
Data Starts on Row( 2 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
// end of the Open command from the "Source" script of the main data table
// don't forget to add the semicolon after the closing ")" above since we are added more commands below
// Get the list of scripts that are contained within the main data table
lstScriptNames = dtCurrent << Get Table Script Names;
// Loop through all the script names and move them to the updated dat table
For( i = 1, i <= N Items( lstScriptNames ), i++,
// pull each script name from the list of scripts
scriptName = lstScriptNames[ i ];
// By opening the updated data file with the copied Open command, we already created the "Source" script
IF(scriptName != "Source",
// Get the "contents" of this script from the main data table
scriptDef = dtCurrent << get table variable( scriptName );
// Insert this script into the updated data table
Eval(
Parse(
Eval Insert( "dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )" )
) // end Parse statement
); // end Eval statement
) // end IF statement
); // continue For Loop until all scripts in the main data table have been copied
// At the completion of this script, you will have two data tables open with exactly the same name.
//
// The first table is the "main" table that contains the old data and all the source scripts.
// When you attempt to close this table you will NOT be prompted to "save" the table since we made
// no changes to it. The "main" table must be closed prior to closing and saving the "updated" table since
// we are going to save the "updated" table in the same location with the same name as the original "main"
// table since we are "replacing" the old table with the update version.
//
// The second table is the "updated" table which we created with the above script.
// This table has been loaded with the "updated" data file found in the "Source" script. It now also
// contains all of the scripts that were contained in the "main" data table for continued use with the
// updated source data. You will note that is has exactly the same table name as the "main" table, but if you
// inspect the rows of data you will find the only difference between the two table is that the "updated" table
// contains the additional rows of data from the updated source data file.
//
// The objective is to close the "main" table which should not prompt for a save, then close the "updated" table
// save it at the prompt over the original "main" table. When closing the "updated" table, you do have the option
// save it to any location you desire with any name you desire. My goal for creating this script was to replace
// the original table with the updated table.
//
// I will note here that I assumed I could not add the close of the main table and the save
// of the updated table to this script since by closing the main table (which must be done first)
// I would be closing the table in which this executing script is located. As such I assume the close action
// would stop the script.Re: JMP 데이터 테이블 업데이트좋아요,
빠른 응답에 감사드립니다. 내 문제는 귀하가 제공한 샘플의 개념과 약간 다르지만 귀하는 제가 크게 발전하는 데 필요한 통찰력을 주셨습니다.
위의 솔루션에서는 이제 새 데이터 파일의 전체 내용을 이전 데이터 파일에 추가할 수 있지만 내 문제는 새 파일에 단순히 추가 데이터 행이 있다는 점에서 업데이트된 데이터의 문자 버전으로 "이동"하는 것과 관련이 있습니다. 첫번째. 두 개의 개별 데이터 세트를 연결/상관시키는 문제가 아닙니다.
귀하의 샘플을 통해 원본 테이블에서 "소스" 스크립트를 실행할 때(실제로 원본 데이터와 이름 및 위치가 동일한 새/업데이트된 소스 데이터 파일을 가리킴) 새 데이터 테이블이 생성된다는 점을 이해하게 되었습니다. "소스" 스크립트만 존재합니다. 이제 원하는 대로 현재/업데이트된 데이터가 포함된 새 테이블이 생겼지만 다른 스크립트는 전혀 포함되지 않았을 때 손실되었습니다.
샘플에서는 "이제 이전 테이블의 스크립트를 새 테이블에 복사"하여 데이터 병합을 종료했습니다.
전구 순간....할 수 있나요?
그래서 포럼을 검색하면서 한 테이블에 스크립트를 나열하고 다른 테이블에 삽입하는 몇 가지 예를 발견했습니다. 어느 시점에서는 이와 같은 참조를 가리킬 수 있도록 다른 토론에 연결하는 방법을 알아낼 것입니다. 그러나 지금은 샘플의 코드가 다음과 같습니다.
단일 스크립트의 경우:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
scriptName = "Oneway";
scriptDef = dt << get table variable( scriptName );
dt2 = New Table( "little class" );
Eval(
Parse(
Eval Insert(
"
dt2 << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
테이블의 모든 스크립트에 대해:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = New Table( "little class" );
Wait( 3 );
lstScriptNames = dt << Get Table Script Names;
Wait( 3 );
j = N Items( lstScriptNames );
For( i = 1, i <= N Items( lstScriptNames ), i++,
// scriptName = lstScriptNames;
scriptName = lstScriptNames( i );
scriptDef = dt << get table variable( scriptName );
Eval(
Parse(
Eval Insert( "dt2 << New Script( \!"^scriptName^\!", ^scriptDef^ )" )
)
);
);
이제 - "소스" 스크립트의 복사본을 만들고 dt 변수에 테이블 할당을 추가한 다음 루프와 함께 open 명령을 따라 모든 스크립트를 복사하려고 시도했습니다. scriptName 및 scriptDef 값을 올바르게 로드할 수 없습니다. scriptName은 현재 테이블의 올바른 스크립트 목록을 로드하는 것으로 보이지만 scriptDef 호출은 정의를 가져오지 않습니다.
따라서 나는 훌륭하게 작동하는 반복된 수동 단일 복사본을 사용하여 각 테스트 스크립트를 수동으로 추가했습니다. 결과 코드는 다음과 같습니다.
dtCurrent = Current Data Table();
dtUpdate = Open(
"Z:\JMP Data Analysis\SLOC Metrics\Data Update Testing\Project_Metrics.xlsx",
Worksheets( "Code_Change_Metrics" ),
Use for all sheets( 1 ),
Concatenate Worksheets( 0 ),
Create Concatenation Column( 0 ),
Worksheet Settings(
1,
Has Column Headers( 1 ),
Number of Rows in Headers( 1 ),
Headers Start on Row( 1 ),
Data Starts on Row( 2 ),
Data Starts on Column( 1 ),
Data Ends on Row( 0 ),
Data Ends on Column( 0 ),
Replicated Spanned Rows( 1 ),
Replicated Spanned Headers( 0 ),
Suppress Hidden Rows( 1 ),
Suppress Hidden Columns( 1 ),
Suppress Empty Columns( 1 ),
Treat as Hierarchy( 0 ),
Multiple Series Stack( 0 ),
Import Cell Colors( 0 ),
Limit Column Detect( 0 ),
Column Separator String( "-" )
)
);
scriptName = "Mod vs Unmod Code Change Sample";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "Individual & Moving Range chart of % Code Change";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "Total Lines vs. Asset / Code Analyzed";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "% Code Change vs. Asset / Code Analyzed";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "UpdateDataTable";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "TestingTableUpdateScript";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "CopySingleScriptFromOldTable";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
scriptName = "CopyAllScriptsFromOldTable";
scriptDef = dtCurrent << get table variable( scriptName );
Eval(
Parse(
Eval Insert(
"
dtUpdate << New Script( \!"^scriptName^\!", ^scriptDef^ )
"
)
)
);
원래 JMP 테이블 파일(소스 데이터 파일의 마지막 버전으로 생성됨)이 열려 있으면 이제 업데이트된 소스 데이터 파일에서 새 테이블을 생성한 다음 모든 스크립트를 새 테이블에 복사하는 이 스크립트를 실행할 수 있습니다. 그런 다음 두 개의 JMP 테이블을 열었습니다. 둘 다 동일한 제목과 동일한 스크립트를 사용하지만 하나는 이전 데이터가 있고 다른 하나는 새 데이터(더 많은 데이터)가 있습니다. 이제 이전 테이블을 닫고 같은 위치에 새 테이블을 바로 저장합니다.
팔! 실행 가능한 모든 스크립트로 데이터를 업데이트했습니다. 파일 위치와 이름이 동일하므로 필요에 따라 주별 또는 월별 보고서 업데이트마다 프로세스를 반복할 수 있습니다.
나는 실제 코드에서 스크립트 이름을 관리할 필요 없이 다른 데이터 세트에서 동일한 스크립트를 사용할 수 있도록 모든 스크립트를 동적으로 로드하기 위한 자동화된 루프를 얻고 싶습니다. 지금은 루프 문제를 파악할 때까지 수동 버전을 사용하여 진행하고 있습니다.
결국 해결책을 찾을 수 있도록 도와주신 빠른 응답과 샘플에 진심으로 감사드립니다.
Re: JMP 데이터 테이블 업데이트JMP 13이 있으므로 다음과 같이 할 수도 있습니다.
NamesDefaultToHere(1);
// Make some 'new data' (imported from Excel)
dt2 = New Table( "New Data",
Add Rows( 10 ),
New Column( "x",
Numeric,
"Continuous",
Formula( Random Normal() )
),
New Column( "y",
Numeric,
"Continuous",
Formula( Random Integer(10, 20 ) )
)
);
dt2 << runFormulas;
Column(dt2, "x") << deleteFormula;
Column(dt2, "y") << deleteFormula;
// Make some 'old data' containing a saved script (stored as a JMP table)
dt1 = New Table( "Old Data",
Add Rows( 20 ),
New Script(
"y vs. x",
Graph Builder(
Variables( X( :x ), Y( :y ) ),
Elements( Points( X, Y, Legend( 5 ) ), Smoother( X, Y, Legend( 6 ) ) )
)
),
New Column( "x",
Numeric,
"Continuous",
Formula( Random Normal() )
),
New Column( "y",
Numeric,
"Continuous",
Formula( Random Integer(1, 10 ) )
)
);
dt1 << runFormulas;
Column(dt1, "x") << deleteFormula;
Column(dt1, "y") << deleteFormula;
// Update dt1 from dt2 using data table subscripting (requires JMP 13 or later)
Wait(3);
firstNewRow = NRows(dt1) + 1;
dt1 << addRows(NRows(dt2));
dt1[firstNewRow::NRow(dt1), 0] = dt2[0, 0];
Re: JMP 데이터 테이블 업데이트데이브,
특정 요구 사항에 따라 업데이트 플랫폼이 솔루션이 될 수 있습니다. 그러나 JSL을 사용하면 필요한 모든 작업을 수행한 다음 재구성된 데이터 테이블에 원본 스크립트를 추가할 수 있습니다. 이는 원래 테이블의 포함된 스크립트를 새로 형성된 테이블에 복사하는 매우 간단한 코드 조각입니다.
Re: JMP 데이터 테이블 업데이트이 스레드는 오래된 스레드이지만 제가 겪고 있는 문제와 관련하여 찾을 수 있는 유일한 스레드인 것 같습니다.
저는 새로운 JMP를 사용하고 있으며 13.1을 사용하고 있습니다. 저는 JMP 사용법을 배우면서 지표 추적 및 보고에 사용하는 데이터 세트를 가져왔습니다.Excel 파일을 가져오고 스크립트를 생성하여 분석을 수행할 수 있습니다.훌륭하게 작동합니다!
이제 문제는 다음과 같습니다.
이 노력의 소스 데이터는 매주 또는 매월 업데이트됩니다.내 목표는 JMP를 설정하여 매달 데이터에 대해 동일한 초기 분석을 수행하되 JMP 테이블을 최신 Excel 데이터로 업데이트하는 것입니다."소스" 스크립트를 사용해 보았으나 원본 JMP 테이블에 저장한 스크립트가 포함되지 않은 새 JMP 테이블이 생성되었습니다.
"업데이트" 기능에 대해 읽었지만 이는 테이블 내의 데이터가 변경된 경우 테이블을 업데이트하는 기능인 것 같습니다."업데이트" 기능이 소스 데이터 세트를 "재동기화"하거나 "가져오기"하고 시간 경과에 따라 업데이트/증가하는 데 사용할 수 있는 유일한 방법입니까?
어떤 도움이라도 대단히 감사하겠습니다.
데이브
Re: JMP 데이터 테이블 업데이트이 스레드의 처음 두 게시물을 보면 JMP의 테이블 업데이트 기능을 언급하고 계신지 전혀 몰랐습니다. 사실 저는 최근에 Update를 꽤 많이 사용해 왔지만 JMP 데이터 테이블 이외의 다른 어떤 것과도 작동할 것이라는 인상을 받은 적이 없습니다. 실제로 (데이터) 테이블 도구 모음이나 (데이터) 테이블 메뉴를 통해 액세스할 수 있습니다. 또한 귀하의 원본 게시물에는 귀하가 하고 있는 일에 대한 자세한 설명이 제공되지 않았기 때문에 아무도 응답하지 않았습니다.
Excel의 새 데이터로 JMP의 테이블을 정기적으로 업데이트하는 상황에서는 Excel 통합 문서의 데이터를 JMP로 가져오는 스크립트를 작성한 다음 유지 관리되는 데이터 테이블을 Excel 통합 문서에서 생성된 데이터 테이블로 업데이트합니다. 즉, Join, Update 및 Concatenate 기능이 수행하는 조인을 외부 데이터 소스와 함께 수행하는 기능을 추가하는 것은 흥미로운 기능일 수 있습니다. JMP에는 이미 SQL을 지원하는 외부 데이터베이스에 이 기능이 있지만 SQL 데이터베이스에서만 작동합니다. Excel은 SQL 데이터베이스는 물론이고 데이터베이스도 아니므로 귀하의 경우에는 SQL 쿼리를 활용할 수 없습니다. JMP에는 현재 데이터 조인을 위해 Excel 통합 문서의 워크시트를 직접 쿼리할 수 있는 원클릭 기능이 없습니다.
Re: JMP 데이터 테이블 업데이트saitcopuroglu, 결국 JMP 기술 지원팀에 전화하게 되었습니다.위에서 설명한 "해결 방법"은 현재 Excel 스프레드시트에서 업데이트하는 상황에 대한 유일한 솔루션입니다.업데이트 기능은 한 JMP 데이터 테이블에서 다른 JMP 데이터 테이블로 업데이트하도록 설계되었다고 들었습니다.하지만 이 문제는 향후 JMP 버전에 대한 아이디어로 제출될 예정입니다.
Re: JMP 데이터 테이블 업데이트더 잘 이해할 수 있도록 Excel/jmp/jsl 파일을 제공할 수 있습니까? 나도 궁금해
Re: JMP 데이터 테이블 업데이트누구든지....누구든지...누구?
업데이트 기능을 실험해 보았습니다.JMP는 데이터 테이블에 'Source'로 저장된 스크립트를 덮어쓰는 것으로 보입니다.처음 업데이트하면 모든 것이 잘 작동합니다.그러나 업데이트가 호출되면 JMP는 "소스"로 저장된 스크립트를 새 테이블에서 원본 테이블을 업데이트하는 스크립트로 즉시 덮어씁니다.다음에 "소스" 스크립트에서 업데이트를 시도하면 아무 일도 일어나지 않습니다.그래서 저는 이것을 시도했습니다. 데이터 테이블의 "Source" 스크립트 이름을 "Update"로 바꾸고 다시 시도했습니다.이번에는 "업데이트" 스크립트는 변경되지 않았지만, "소스"라는 스크립트가 데이터 테이블에 새로 추가되었습니다.이 "해결 방법"은 분명히 효율적이지 않으며 필요하지도 않습니다.