Subscribe Bookmark RSS Feed

Setting the Decimal format in a Quantiles Table

Hegedus

Community Trekker

Joined:

Jun 23, 2011

Hi,

 

I do fit Y by X with continuous and ordinal variables repectively.  No problem there and it produces a table with the quantiles and they are often to 6 decimal places.  I can adjust the formatting in each column seperately, but is there a shortcut that would do the table as a whole?  It is a bit of annoyance to do each column indivdually.  The usual shortcut for repeating the command (command on a Mac) does not seem to work.

 

Thanks

Andy

1 ACCEPTED SOLUTION

Accepted Solutions
ms

Super User

Joined:

Jun 23, 2011

Solution

I haven't found a shortcut and holding down cmd to broadcast the format command to all columnboxes seems not work, as you say. 

The way I do it is to double-click on a numeric column to open the "Column Numeric Format dialogue, enter the desired format and then tab through the check boxes while hitting the return key for each target column (JMP12 for Mac).

It is also of course possible to do with JSL. An example: 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
ow = dt << Oneway(Y(:height), X(:age), Quantiles(1));
// Set nr of decimals for all Number Col Boxes in a Table Box
i = 1;
While(
    Is Scriptable(Try(ncb = Report(ow)[Outline Box("Quantiles")][Number Col Box(i)])),
    ncb << Set Format("Fixed Dec", 8, 1);
    i++;
);

To apply it to any (current) report, the code below could be used (run in script window or as a custom menu item).

Names Default To Here(1);
// Get list of Table Box(Outline) titles
L = {};
i = 1;
While(Is String(Try(L[i] = (r[Table Box(i)] << parent) << get title)), i++);
// Dialog to choose Table Box and numeric format
New Window("Set numeric format",
    <<modal,
    cb = Combo Box(L),
    Table Box(
        String Col Box("", {"Width", "Dec"}),
        nceb = Number Col Edit Box("", [8, 2])
    ),
    Button Box("OK",
        tb = cb << get selected;
        {w, d} = nceb << get;
    )
);
// Apply format to all num columns of Table
r = Current Report();
i = 1;
While(Is Scriptable(Try(ncb = r[Outline Box(tb)][Number Col Box(i)])),
    ncb << Set Format("Fixed Dec", w, d);
    i++;
); 

 

4 REPLIES
ms

Super User

Joined:

Jun 23, 2011

Solution

I haven't found a shortcut and holding down cmd to broadcast the format command to all columnboxes seems not work, as you say. 

The way I do it is to double-click on a numeric column to open the "Column Numeric Format dialogue, enter the desired format and then tab through the check boxes while hitting the return key for each target column (JMP12 for Mac).

It is also of course possible to do with JSL. An example: 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
ow = dt << Oneway(Y(:height), X(:age), Quantiles(1));
// Set nr of decimals for all Number Col Boxes in a Table Box
i = 1;
While(
    Is Scriptable(Try(ncb = Report(ow)[Outline Box("Quantiles")][Number Col Box(i)])),
    ncb << Set Format("Fixed Dec", 8, 1);
    i++;
);

To apply it to any (current) report, the code below could be used (run in script window or as a custom menu item).

Names Default To Here(1);
// Get list of Table Box(Outline) titles
L = {};
i = 1;
While(Is String(Try(L[i] = (r[Table Box(i)] << parent) << get title)), i++);
// Dialog to choose Table Box and numeric format
New Window("Set numeric format",
    <<modal,
    cb = Combo Box(L),
    Table Box(
        String Col Box("", {"Width", "Dec"}),
        nceb = Number Col Edit Box("", [8, 2])
    ),
    Button Box("OK",
        tb = cb << get selected;
        {w, d} = nceb << get;
    )
);
// Apply format to all num columns of Table
r = Current Report();
i = 1;
While(Is Scriptable(Try(ncb = r[Outline Box(tb)][Number Col Box(i)])),
    ncb << Set Format("Fixed Dec", w, d);
    i++;
); 

 

Hegedus

Community Trekker

Joined:

Jun 23, 2011

I think you should put this into the feature request bucket.  I think it is very common for the output of a table to have similar formatting across columns.

 

Andy

billw_jmp

Staff

Joined:

Jul 2, 2014

One thing you can try is to highlight all of the columns that you want to set the number of decimal places and then right click in one of the highlighted column headers and select "Standardize Attributes" .  From there select the drop down for Attributes and select "All".  This will highlight all of the attribute settings including setting the number of decimal places.

 

HTH

Bill

 

 

Hegedus

Community Trekker

Joined:

Jun 23, 2011

I tried setting the format in the data column. The formatting did not proprogate to the analysis table.

 

Andy