Unexpected error during scriptHello,
I'm writing a script to deconvolute a json file.
Once in jmp, the resulting table is composed of groups of columns labelled such as study.xyz, study.cro, groups.xyz, groups.id, test.xyz, test.name,...
I'm trying to create a series of tables for each of the groups such as study/groups/test.
I have a script that does that well when each subset is handle separately but for some reasons it stops creating the subset table when it moves to the next group.
I can move around the order in which those groups are processed and the first group to be 'subseted' for well.
In other words, if I try to subset 'study' first, then 'groups' is not processed
If I move the script portion dedicated to 'groups' in first position, it get processed but then 'study' does not.
I'm baffled. Any suggestions would be greatly appreciated.
Best,
Sebastien
try(data table("P0_json")<<CLOSE window=""></CLOSE>Here's the scripts:
Automation and ScriptingData Blending and CleanupMass CustomizationQuality and Process EngineeringRe: Unexpected error during scriptSave the script from the wizard.
Re: Unexpected error during scriptThis could also be a solution, but I was using the script to avoid having the user go through the wizard.
Thanks a lot for the detailed explanation,
SebastienRe: Unexpected error during scriptFantastic. Thanks for the feedback. I had not considered that approach.
Best,
SebastienRe: Unexpected error during script@Thierry_S has already answered your original question. Here's a different answer that might avoid writing any JSL.
You can use the JSON Wizard to get the tables you need, assuming your data is similar to this:
One way to represent your data in JSONOne way to represent your data in JSONOne way to represent your data in JSON
Open in the wizard:
Guess and stack to get the first viewGuess and stack to get the first viewGuess and stack to get the first view
Remember to stack!
Choose what JSON tags generate rows in the JMP tableChoose what JSON tags generate rows in the JMP tableChoose what JSON tags generate rows in the JMP table
Explanation: The wizard reads the JSON text, scanning for tags. Tags checked as row cause a row to be added to the table. Tags checked as col add columns.
Node shows the nesting of the text in the JSON.
Select the columns you don't want (easy on the column headers at the bottom) then pick No ColumnSelect the columns you don't want (easy on the column headers at the bottom) then pick No ColumnSelect the columns you don't want (easy on the column headers at the bottom) then pick No Column
You can select columns in the table preview, or do them one at a time in the GUI above the preview, or select them in the node tree. The No Column is applied to all selected columns.
At this point you might also uncheck Groups as a row generator. I forgot, and it made no difference this time. Depends on the JSON organization.At this point you might also uncheck Groups as a row generator. I forgot, and it made no difference this time. Depends on the JSON organization.At this point you might also uncheck Groups as a row generator. I forgot, and it made no difference this time. Depends on the JSON organization.
Click OK
The resulting table's Source script can be re-run to open the table againThe resulting table's Source script can be re-run to open the table againThe resulting table's Source script can be re-run to open the table again
Repeat for the other table
Repeat the process to get the other table. Uncheck the study row to remove a blank row from the JMP table.Repeat the process to get the other table. Uncheck the study row to remove a blank row from the JMP table.Repeat the process to get the other table. Uncheck the study row to remove a blank row from the JMP table.
The JSON I used is attached, yours is probably a little different, so the steps may be a little different. You can also rename the columns (Column Name field) but I think they are already what you want.
Re: Unexpected error during scriptHi again,
There are a few Comments that are no longer meaningful, please disregard.
Best,
TSRe: Unexpected error during scriptHi,
I took a bit of time to debug but the main problem is that you were not pointing to the original table after the first subset. Also, you referred to column using your Col_List variable which can create odd results: I replace those calls with the more standard "Column (, )".
Here is the updated script
Names default to Here (1);
try(data table("P0_json")<<CLOSE window=""></CLOSE>