cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar

Overview of Iteration

Started ‎11-08-2022 by
Modified ‎11-08-2022 by
View Fullscreen Exit Fullscreen

Scripts are procedural. In other words, JMP evaluates a script beginning with the first line and continuing until the last line. Some scripts require JMP to repeat an action multiple times. But you don't repeat the code for that action in your script for every time you want JMP to perform the action. Instead, you use special iteration functions to repeat that portion of the code. In some cases, the number of iterations might be the same every time the script runs. For example, you need to create control charts for a fixed number of responses. In other cases, the number of iterations might depend on the situation and so it can change each time JMP evaluates the script. For example, you want to analyze all of the numeric columns with the Distribution platform, and be able to run that script against any data table. Sometimes the number of iterations might depend on achieving a specific condition. There are JSL functions that provide useful information for determining the number of iterations. N Col returns the number of columns in a data table or a matrix, and N Row returns the number of rows in a data table or a matrix. N Items returns the number of items in a list, and N Table returns the number of open data tables. The N Col function is used a lot, so let's take a quick look at it. This function returns the number of columns in the current data table if no argument is provided, or the number in a specified data table or matrix if you include the optional argument.