The scripting index under the Help menu has some useful information for you here. I searched for 'sort' this way:
![ih_0-1629917993220.png ih_0-1629917993220.png](https://community.jmp.com/t5/image/serverpage/image-id/35318iA742F3CBC9C00B9D/image-size/medium?v=v2&px=400)
If you are happy with the formula you used for the % Total column, you can use the scripting index to find a function to create a new column in the data table. Or, you could use theScripting Tools add-in to install a function called 'Copy Column Script' to the cols menu. Then you can just select the column, copy the script, and paste that in your script. If I understand your requirement for that column though you could just divide the N Row column by the sum of the column N Row.
Putting that together might look like this:
Names default to here(1);
// The function from your example:
dtSummarized = dt << << Summary(
Group(
:Open VIO,
:Open SCLK,
:Open SDATA,
:Open USID,
:Open RF1,
:Open RF2,
:Open RF3,
:Open RF4,
:Open RFC
),
Freq( "None" ),
Weight( "None" )
);
// dtSummarized = Current Data Table();
// From Scripting Index
dtSummarized << Sort( replace table, By( :N Rows ), Order( Descending ) );
// From Scripting Tools Add-in
New Column("% Total", Numeric, "Continuous", Format("Percent", 12, 2), Formula(:N Rows / Col Sum(:N Rows)), Set Display Width(44));