BookmarkSubscribe
john_hutchinson
Community Trekker

make a control chart with a variable for column

I want to make different control charts based on different columns of data, where the column name are numbers based on an SPC chart numbering system.

For example if I want a control chart based on column "45038", this works fine

chartnum = 45038;

ct1 = Control Chart(

    Sample Label( :lot ),

    KSigma( 3 ),

    GetLimits(\limits.jmp" ),

    Chart Col(

        :"45038",

        XBar( Limits Precision( 0 ) ),

        R( Limits Precision( 0 )) 

    )

);

I can replace :"45038" with name("45038").  But I get a syntax error if I replace it with name (chartnum) or name(char(chartnum))

Any ideas?

0 Kudos
4 REPLIES 4
ms
Super User ms
Super User

Re: make a control chart with a variable for column

Try

As Column(Char(chartnum))


Or simply

:(Char(chartnum))

john_hutchinson
Community Trekker

Re: make a control chart with a variable for column

Thank you for the suggestion!

Both options enable to control chart to display the data from the appropriate column.

Unfortunately, both options do not find the control limits in my limits.jmp table.  Odd.

ct1 = Control Chart(

    Sample Label( :lot ),

    KSigma( 3 ),

    GetLimits("C:\_LOCAL\_Aurrion\_ToBeSorted\charts-working\JMP\limits.jmp" ),

    Chart Col(

//        :(Char(chartnum)), // display chart, but doesn't find limits in file.

        :"45038", // display chart and correct limits

//        As Column(Char(chartnum)), // displays chart, but doesn't get limits from file.

        XBar( Limits Precision( 0 ) ),

        R( Limits Precision( 0 )) 

    );

0 Kudos
ms
Super User ms
Super User

Re: make a control chart with a variable for column

Ok, maybe a reference for the column is needed. Try this:

dt = Current Data Table();

chartnum = 45038;

col = Column(dt, Char(chartnum));

ct1 = Control Chart(

    Sample Label(:lot),

    KSigma(3),

    Chart Col(col, XBar(Limits Precision(0)), R(Limits Precision(0))),

    GetLimits("C:\_LOCAL\_Aurrion\_ToBeSorted\charts-working\JMP\limits.jmp")

);

john_hutchinson
Community Trekker

Re: make a control chart with a variable for column

Thanks!

I dont quite understand the different behaviors, but it works!

0 Kudos