cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

JMP Wish List

We want to hear your ideas for improving JMP. Share them here.
Choose Language Hide Translation Bar
0 Kudos

Col Moving Quantile() function

I would like a built-in function similar to Col Moving Average() that computes a moving (rolling) quantile of a a column. You could call it Col Moving Quantile() and/or Col Moving Median().

I wrote a user function (attached) which works well enough for small tables, but it uses a very inefficient approach. I know for absolutely sure that there are much more efficient ways to implement this function that don't involve brute force recalculation at each rolling step. Those approaches are beyond my coding ability.

Add Custom Functions(
	New Custom Function(
		"x",
		"Col Moving Quantile",
		Function( {col, p, before, after, dt = Current Data Table()},
			{coldata = Column( dt, col ) << Get As Matrix, from = Max( Row() - before, 1 ), to, to = Min( Row() + after, N Rows( dt ) )},
			Quantile( p, coldata[Index( from, to )] )
		)
	)
	
	// === Documentation ===
	<<Formula Category( "Statistical" ) //
	<<Scripting Index Category( "Statistical+" ) //
	<<Description( "Returns the moving (rolling) quantile of the specified column." ) //					
	<<Prototype( "x:Col Moving Quantile( ColName( string ), p, before, after, <Table reference> )" ) //		
	<<Parameter( "String", "ColName( string )" ) //
	<<Parameter( "Number", "p" ) //
	<<Parameter( "Number", "Before" ) //
	<<Parameter( "Number", "After" ) //
	<<Parameter( "Name", "Table" )
);

 
1 Comment
Ryan_Gilmore
Community Manager
Status changed to: Archived
We are archiving this request. If this is still important please comment with additional details and we will reopen. Thank you!