Who can help to optimize a basic function for completing rows in a data table?

Reply
New Contributor
Posts: 2

Who can help to optimize a basic function for completing rows in a data table?

Hello All,

I am looking for some advise from more experienced JMP users for the following problem.

I frequently need to work with a data tables that contain up to 4 rows per unit. However some of the system parameters are only recorded for the first enry of an individual unit although applicable for the other rows associated to that unit as well.

In order to be able to analyze and group the data I need these system parameters to be completed for all rows of an unit.

As I have no chance to alter the data recording to the database I need to take care of this after data base extraction before any analysis.

I therefore created a workaround as shown below.

It provides the desired result but is very slow and actually not feasible for data tables with more than 1000 rows.

dt = Current Data Table();

dt<<Sort(By(:unit), Order(Ascending), Replace Table);

Smiley Tonguearam_1 << Formula (for each row(Smiley Tonguearam_1 [row()+1] = (if (:unit[row()] == :unit [row()+1],

  Smiley Tonguearam_1 [row()], Smiley Tonguearam_1 [row()+1] )),

  ),

  Eval Formula

);

I am sure there is a more efficient and elegant way to solve this problem, but I have to admit that my skills are very limited.

I appreciate any input from more experienced users.

Thanks,

Lutz

Super User
Posts: 18,984

Re: Who can help to optimize a basic function for completing rows in a data table?

Post on the JMP, not SAS forum for JMP help Smiley Happy

Space: Discussions | JMP User

Ask a Question
Discussion stats
  • 1 reply
  • 139 views
  • 0 likes
  • 2 in conversation