- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Tips and Tricks - best practice with JMP/JSL
There is a wonderful blog post by @Craige_Hales : How Do You Draw a Circle?
It nicely illustrates that there are multiple solutions to every problem - with varying degrees of success in achieving the goal and in investing ressources.
And often there is not the ONE solution with maximum points in all categories:
- goal was met
- length of code
- speed (to write the code)
- speed (to execute the code)
- complexity (to understand the code)
- complexity ( to remember the code)
Examples:
topic | standard approach | faster approaches | links |
General | |||
learn scripting | trial and error | watch the recordings of theJSL Scripters Club Meetings | |
Data import | |||
open multiple data files | use open() (inside a for loop) | use MFI (faster csv reader!) | Open multiple Files |
get a list of files | generate the file list - via Python, command prompt etc. and paste it into a new JMP table | MFI → right click on file list → Make into data table | |
find a file in a deep/complicated network tree structure | use MFI or Windows File dialog | create a wrapper for Python/GLOB | |
Data tables | |||
change column entries | step by step via for loop | data table subscripting | Data table subscripting |
... | dt << begin/end data update; | Very slow loop behaviour | |
add columns to a data table | merge data tables via Tables/Update | first aggregate via Tables/Summary, then merge via Tables/Update | Speed up Tables/Update |
column aggregation with restrictions (1) | the new approach via Where (JMP18)
is easy to remember, but very slow doesn't work yet. | use the old approach via If:
It looks more complicated but it's orders of magnitude faster *) | Col-Median-and-others:Where option |
column aggregation with restrictions (2) | *) unfortunately, with a character comparison Col... gets very (!!!) slow: | ->use if(:sex2==1,...) | How-do-I-use-the-Col-Maximum-Formula-with-a-where |
... | replace | How-do-I-use-the-Col-Maximum-Formula-with-a-where | |
count words | e.g. count xxx in :col: N Rows(loc(Words(:col),"xxx")) |
| |
rank unique |
| support this wish with a Kudo:
| |
Recode | can be very slow in combination with other options | apply the option in a second step | |
replace values with other values | for loop or Recode | use DataTable subscripting | Replace missing values with 0 Should you Loop through a data table or use Recode, or use Get Rows Where to change values in a data... |
select rows based on a formula | If dt << select where() is too slow ... split it into 2 steps: | myrows= dt << get rows where(); dt << select rows(myrows) | Formula to check if any of a list of items is contained in the rows of a column |
spec calcualations | some manual JSL code | support this wish with a Kudo: | 🙏 is in spec (value) |
Graphs | |||
Reports | |||
Export | |||
Database access | |||
Neural Networks | |||
... | |||
[More Topic Containers like this]
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Speeding up JMP/JSL
-> Table moved to main post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Speeding up JMP/JSL
It depends a lot on what you are doing. Some good general tips can be found from Scripting Guide > Efficient Scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Speeding up JMP/JSL
Thanks, a good place to start ...
Going further, how about a list with as many entries as possible along the idea:
If you want to do this, you probably thought of this approach - but concerning speed, the other approach is much better!
Who is interested in sharing his secrets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Speeding up JMP/JSL
-> Table moved to main post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Speeding up JMP/JSL
I added a cool trick to count words by @ian_jmp :
Count number of occurrences of specific words in a string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Speeding up JMP/JSL
great source of Tips and Tricks:
JSL Scripters Club Meetings: 2024 schedule, 2023 complete list with links to recordings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Speeding up JMP/JSL
Wonderful talk on XPath & Subscripting in Reports:
https://community.jmp.com/t5/Abstracts/I-Can-See-It-How-Do-I-Get-It/ev-p/776041