It’s World Statistics Day! To honor the theme of the day, the JMP User Community is having conversations about the importance of trust in statistics and data. And we want to hear from you! Tell us the steps you take to ensure that your data is trustworthy.
Choose Language Hide Translation Bar
Highlighted
vincent_kane
Level I

examples of column formula loops

Trying to ID 9 character words in column :Trim & Case with the following formula

For( i = 1, i < 20, i++,

If( Word((i, Length( :Name( "Trim & Case" ) ) == 9),

  Word( i, :Name( "Trim & Case" ) ),

  ""

)

)

2 REPLIES 2
Highlighted
pmroz
Super User

Re: examples of column formula loops

Try this formula:

word_list = Words(:Name("Trim & Case"), " ");

word9s    = "";

for (i = 1, i <= nitems(word_list), i++,

      if (length(word_list[i]) == 9,

            if (word9s == "",

                  word9s = word_list[i];

                  ,

                  word9s = word9s || "," || word_list[i];

            );

      );

);

word9s;

Highlighted
vincent_kane
Level I

Re: examples of column formula loops

Works well.   Thanks. Much better than mine

Article Labels

    There are no labels assigned to this post.