cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Have your say in shaping JMP's future by participating in the new JMP Wish List Prioritization Survey
Choose Language Hide Translation Bar
SDF1
Super User

JSL help: Report column sorting and Fixed Dec formatting

Hi All,

 

  I'm working on a code from another thread (if interested, you can read on it here and here), but stuck with another modification I'm trying to implement for a larger part of code. [NOTE: turns out it's just item 2, but I wanted to keep the subject of item 1 in there in case other interested readers might want to know.]

 

  Anyway, here are the two things I need help with:

1. I'm having difficulty formatting the columns in the report table box I generate. I tried sending the command <<Format("Fixed Dec", 6, 4) to either the Get As Report call or the Table Box() environment, but neither seem to accept the Format() call. I'd like to set it to something like a width of 6 and 4 decimal places. The output I am working with is below, the code that generated this can be found from the first link above (I just don't want to double-post). Am I not going down enough levels?

 

Update: while writing this, my question I posed at the end prompted me to try going down one more level to each column of interest and then use the << Set Format() send command and it worked. I could loop through columns of the report and set the formats as desired. I used the following JSL code for that.

For( ri = 1, ri <= N Col( dt_results ) - 2, ri++,
		dt_tb[Table Box( 1 )][Number Col Box( ri + 1 )] << Set Format( "Fixed Dec", 6, 4 )
	);

DiedrichSchmidt_0-1636400307577.png

DiedrichSchmidt_3-1636401444848.png

 

 

2. The other thing I'd like to do is set several of the columns to be "sortable". What I mean by this is to give the column in the report table box (above screenshot) the little carat "^" or "˅" so the user can sort the report table box by a column of their choosing. This option is available in the XGBoost platform, see screenshot below, where the Train RSquare column has a "˅" next to it. The Response Screening platform also has this capability, see last screenshot.

DiedrichSchmidt_1-1636400637007.png

DiedrichSchmidt_2-1636400758707.png

 

  So, this turns out to have only one request for help -- item 2. Any feedback is much appreciated, thank you!

 

Thanks!,

DS

1 ACCEPTED SOLUTION

Accepted Solutions

Re: JSL help: Report column sorting and Fixed Dec formatting

Hi, You can send the table box a <<set click sort message, as below. At first, you will not see the "sort" carat icon, as you've got to click on a column header first. Then, clicking will cycle among ascending sort, descending sort, and original order.

 

Cheers,

Brady

 

Names Default To Here(1);

nw = new window("xx", 
	vlistbox(
		tablebox(
			nb1 = number col box("C1", [3,1,2]),
			nb2 = number col box("C2", [2,1,3]),
			<<set click sort
		)
	)
);

View solution in original post

2 REPLIES 2

Re: JSL help: Report column sorting and Fixed Dec formatting

Hi, You can send the table box a <<set click sort message, as below. At first, you will not see the "sort" carat icon, as you've got to click on a column header first. Then, clicking will cycle among ascending sort, descending sort, and original order.

 

Cheers,

Brady

 

Names Default To Here(1);

nw = new window("xx", 
	vlistbox(
		tablebox(
			nb1 = number col box("C1", [3,1,2]),
			nb2 = number col box("C2", [2,1,3]),
			<<set click sort
		)
	)
);
SDF1
Super User

Re: JSL help: Report column sorting and Fixed Dec formatting

Hi @brady_brady ,

 

  Thanks for the feedback, that was exactly what I was hoping to get for the sort functionality, thank you!

 

Thanks!,

DS