Subscribe Bookmark RSS Feed

Speed up for loop formula computation

matt7109

Contributor

Joined:

Jun 9, 2017

Hi,

I need to repeat a process for a few hundred columns and few hundred rows. Basically trying to perform a by variable mean on many columns. I'm pretty new to this, but I'm looking for ways to speed up the process. The code I'm using now is below. I appreciate any input!

ccolListA = dt << get column names( continuous );
For( i = 1, i <= N Items( colListA ), i++,
	dt << New Column( "Part Mean", Numeric, Formula( Col Mean( :(Column( dt, colListA[i] )), :Part, :SN ) ) )
);
1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

Use

     Tables==>Summary

and then Join the data table back to the original table

     Tables==>Join

Jim