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

Using Row Functions

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

So, you learned about the For function, which you can use for practically any kind of iteration. There's also a special function for iterating down the rows of the data table, and that's the For Each Row function. This function only requires one argument, which is the body or code that you want JMP to evaluate row-wise. For Each Row iterates down the rows of the data table until it comes to the end, so it simplifies the syntax by eliminating the need to maintain a counter or index and use a subscript. In fact, the code for the body appears very much like the expression in the Formula Editor. In some cases, you might want to use the Row function while iterating down the rows of the data table. This function returns the current row in the row-wise iteration. And you can also use it on the left side of an assignment, which enables your code to determine the current row for the iteration. Like the N Col function, the N Row function returns the number of rows in either the current data table if no argument is given, or a specified data table or matrix. But remember, it's not necessary if you're using the For Each Row function.