Choose Language Hide Translation Bar
Highlighted
AndresGlez
Level III

Common X axis for Graph Builder by loop taking max and min value from a column

Good day JMP community, hope you can help me to solve this concern.

We need to show performance in terms of rework rate of a series of defects by tool/day, due to different allocation of tools some period of time, not all tools are utilized the same days, thus charts are giving me different X axis (:DATE INSP).

Attached is a sample raw data, then also attached script for my approach.

First chart created is the overall defect rate by DATE INSP, then I made a loop to create same chart per tool, however as you can see X axis is different for each tool, depending on the utilization, I would like to set a fixed day based on the Max, Min :DATE INSP to make all charts common with the Overall chart.

I guess my error is to get the correct expression for the min and max date, however I do not see any error displayed in the log.

Thanks in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Common X axis for Graph Builder by loop taking max and min value from a column

Did it fail while running against the sample data table?  What version of JMP are you using?

I tested the code on JMP 13 and found that there is an issue with using a variable value for an offset reference in the line

nw[theTitle][axisbox( 1 )] << paste axis settings;

so I changed it to force an absolute reference

eval(parse("nw[\!""||theTitle||"\!"][axisbox(1)] << paste axis settings;"));

It now seems to work.  I have attached the complete script

Jim

View solution in original post

6 REPLIES 6
Highlighted
txnelson
Super User

Re: Common X axis for Graph Builder by loop taking max and min value from a column

I think I got your script to kind of do the min and max setting with just adding in the proper additions to the Substitute function

Expr( __lay__ ), lay[j],
Expr( __tool__ ), tool[i],
Expr( __mind__ ), mind,
Expr( __maxd__ ), maxd

I have attached this version of the script as SampleScript1

However, I believe there is a better way, so I have created a second script, SampleScript2, that takes the actual all of the axis settings from the Layer graph and applies them to each of the graphs, so that all of the settings are properly set.

 

Jim
Highlighted
AndresGlez
Level III

Re: Common X axis for Graph Builder by loop taking max and min value from a column

HI @txnelson SampleScript1 is working,  but as each chart is displayed I got your point why should be better to use SampleScipt2, however I am seeing an error when trying to use SampleScript2 , then it stops only in the first chart of per tool due to the error.

By checking the log this is the error displayed:


Cannot subscript Display Box{50914} in access or evaluation of 'nw[theTitle]' , nw[/*###*/theTitle]

In the following script, error marked by /*###*/ 

...

nw[/*###*/theTitle][axisbox( 1 )] << paste axis settings;

...

Highlighted
txnelson
Super User

Re: Common X axis for Graph Builder by loop taking max and min value from a column

Did it fail while running against the sample data table?  What version of JMP are you using?

I tested the code on JMP 13 and found that there is an issue with using a variable value for an offset reference in the line

nw[theTitle][axisbox( 1 )] << paste axis settings;

so I changed it to force an absolute reference

eval(parse("nw[\!""||theTitle||"\!"][axisbox(1)] << paste axis settings;"));

It now seems to work.  I have attached the complete script

Jim

View solution in original post

Highlighted
AndresGlez
Level III

Re: Common X axis for Graph Builder by loop taking max and min value from a column

Yes, I ran the whole script in one.

I have JMP14

Highlighted
txnelson
Super User

Re: Common X axis for Graph Builder by loop taking max and min value from a column

See the addition I made to my last entry
Jim
Highlighted
AndresGlez
Level III

Re: Common X axis for Graph Builder by loop taking max and min value from a column

Thank you @txnelson  this new version works perfectly.

Article Labels