cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar

catch "missing column" error and provide a selection menu

☑ cool new feature
☑ could help many users!

☐ removes a „bug“

☐ nice to have

☐ nobody needs it

 

#myTop10_2022

 

If a user changes the name of a column, references to the column in table scrips are (sometimes) automatically corrected, references in user scrips unfortunately not: Column() vs As Column() vs datable:column vs dt:As name("column") 

 

So, column name changes are very dangerous: there is always the risk that a jsl code doesn't work anymore after the change - like illustrated in the example below.

JMP detects that a noc-existing column is requested and throws an error:

HolgerSp_2-1665848155310.png

 

My wish:
Instead of throwing an error, JMP could open a window and provide a list of column names.

Then the user can select a replacement column.
There should also be a toggle box, allowing the user to decide if the JSL code should be automatically adjusted wit the new column name.

The new behaviour could be enabled/disabled in the preferences menu such that users which got used to error message still have the choice to get it.

 

 

NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.JMP");
Data Table( "Big Class" ):age << Set Name( "age_" );

s = dt << runScript("Distribution"); // column names automatcally adjusted
wait(2);
s = dt << runScript("Set Age Value Labels"); // this script throws an error

 

more wishes submitted by  hogi_2-1702196401638.png

7 Comments
Status changed to: Acknowledged

@hogi - Thank you for your suggestion! We have captured your request and will take it under consideration.

hogi
Level XII

I just saw in @Florian_Vogt 's  JMP17 introductory presentation that the new Workflow Builder catches "missing column" error an shows a window to select a replacement column.
wonderful

 

digging deeper:

 

The Workflow Builder remembers the link between original column name and replacement column, but does NOT change the  JSL code, right?

hogi_0-1666948111716.png


a) Could you please add a button to apply the replacement just once and don't save it for the future

b) Could you please add a button to enable auto-correction of the code. (as an option in the window which asks the user for a replacement column - or as a function in the Reference Manager)

c) at the moment the existence of a replacement rule "overrides" the link to the actual column. Perhaps it makes sense to add an option: use replacement rule just if the original column is missing ?

 

Most important 
Could you please enable this feature also for standard JSL Code execution?

 

hogi_0-1666945637384.png

 

hogi
Level XII

Of course, it will be hard for the auto-correction to fix every single line of code that one can imagine.

 

 

But how about:
first catch all lines of code which "call" the missing column, then for each such line, either fix cases like these automatically:

 

 

:missingcolumn;
column(dt,missingcolumname);
As Column(dt,missingcolumname);

or leave a coment where auto-correction failed:

 

 

columnname_part1="heig"; 
columnname_part2="ht"; 
Parse( ":" || columnname_part1 || columnname_part1) // auto-correction failed: missing column: ":height", replacement column: ":height_new"

 

 

 

hogi
Level XII
SamGardner
Level VII
Status changed to: Investigating
 
SamGardner
Level VII

We will continue to look into this.  It is a bit of a complex problem to address, so if we can come up with a way to address this we will do so.  

hogi
Level XII

Wonderful, sounds good.
I wish you every success