JMP Live Data Table Refresh Script (from Query Builder)This is a question about JMP Live Data Table Refresh scripts. Specifically, those that are source scripts from using Query Builder to connect to a database in JMP with Post Query Scripts.
@LuizaFabreti and I have been playing around with a few examples and it is not clear what gets executed in the PostQueryScript in JMP Live and what does not (what gets ignored).
The PostQueryScript in both cases is adding a new formula column that concatenates two columns (Drug ID and Description) to create a new column.
Has anyone seen this before? Guidance?
@dieterpisot
@Alex_Lippincott
Re: JMP Live Data Table Refresh Script (from Query Builder)To my knowledge JMP Live doesn't treat the PostQueryScript any different than JMP does. Have you tried running the refresh script in JMP? Does it work there?
Re: JMP Live Data Table Refresh Script (from Query Builder)Also the second and third script are runnign into errors like this one:
Name Unresolved: New Formula Column in access or evaluation of 'New Formula Column' , New Formula Column(
Operation( Category( "Character" ), "Concatenate with Space" ),
Columns( :Drug ID, :Description )
) /*###*/
at line 1
Data Table( "Stability_Data_Stacked 2" )
Re: JMP Live Data Table Refresh Script (from Query Builder)My experience is similar. Sometimes it works and sometimes it does not. The New Column() works but anything fancier I recommend doing outside the query in JSL. I'm not sure what is supposed to be supported but I find post query scripts not that great.
Re: JMP Live Data Table Refresh Script (from Query Builder)haven't tested anything, but sometimes you might check if the columns you create and want to use later are actually already created before the interpreter get through the rest of the script. This is most often the issue when referncing to table names, column names created, and other things like search and select rows to be acted on, ...
a wait() or wait(2) might help to check if this is the reason for the error. If yes, you might want to change the code structure, keep wait() command in the script if performance is not dropping, think about alternative approaches, ...
Table manipulations in a postquery script are kinda difficult, you may want to do data table management in the refresh script as soon the table has been created, and not in the fetch itself.
Re: JMP Live Data Table Refresh Script (from Query Builder)I have attached the .jmpquery files that go along with the following. They both work in JMP.
We have a Discovery paper for Baltimore where I am going to make Alex's suggestion: move things outside the Post-Query script before posting to JMP Live OR start from scratch when building the data refresh script (versus relying on Source Script).
Re: JMP Live Data Table Refresh Script (from Query Builder)Having issues posting the second .jmpquery file but happy to email it to you if you want to try it out.
The only difference is the post-query script (in JMP Live, the column is created but is not moved):
// New column: Drug ID, Description
Data Table( "Stability_Data_Stacked" ) << New Column( "Drug ID, Description",
Character,
"Nominal",
Formula( Char( :Drug ID ) || " " || :Description )
) << Move Selected Columns( {:"Drug ID, Description"n}, after( :Description ) ) <<
Run Formulas;
Re: JMP Live Data Table Refresh Script (from Query Builder)I think Martin's guess is a pretty good one. It's some sort of timing issue. It could be that PostQueryScript runs asynchronously and the SQL query returns to the script before the post query is done. The JMP Live JMP session doesn't know it has to wait and returns the table before the post query finishes. Adding a wait() to allow the post query to finish is probably a good workaround.