Choose Language Hide Translation Bar
Highlighted
lwx228
Level VII

How can I write JSL code efficiently if I write a Summary of nearly 1000 columns?

As shown in figure
There is a lot of column data for Summary, and the number of columns can be up to 5000, as the names of different file columns are different and the number of columns is different.
If you can effectively code JSL code, do automatic operations.Thank you!

 

I can only write it like this:

d4=d3<<Summary(sum(3),sum(4),sum(5),sum(6),sum(7),sum(8),sum(9),sum(10),sum(11),sum(12),sum(13),……
……sum(3450),sum(3451),sum(3452),Link to original data table(0));Wait(0);


Working with different files changes the code.Is there an efficient method?

2018-10-20_22-10-02.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: How can I write JSL code efficiently if I write a Summary of nearly 1000 columns?

Here is a simple script using the sample data table, Semiconductor Capability, which has over 100 numeric columns.  The script would work for however many columns that are required.

names default to here(1);
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");

numList = dt << get column names("string",numeric,continuous);

dt2 = dt << Summary(
	Sum( eval(numlist)),
	Freq( "None" ),
	Weight( "None" ),
	Link to original data table(0)
);
Jim

View solution in original post

3 REPLIES 3
Highlighted
txnelson
Super User

Re: How can I write JSL code efficiently if I write a Summary of nearly 1000 columns?

Here is a simple script using the sample data table, Semiconductor Capability, which has over 100 numeric columns.  The script would work for however many columns that are required.

names default to here(1);
dt=open("$SAMPLE_DATA/semiconductor capability.jmp");

numList = dt << get column names("string",numeric,continuous);

dt2 = dt << Summary(
	Sum( eval(numlist)),
	Freq( "None" ),
	Weight( "None" ),
	Link to original data table(0)
);
Jim

View solution in original post

Highlighted
lwx228
Level VII

Re: How can I write JSL code efficiently if I write a Summary of nearly 1000 columns?

Thanks for Jim's help.
So I'm going to have to get the column name ready.

2018-10-21_06-28-30.png

 

 

 

Highlighted
lwx228
Level VII

Re: How can I write JSL code efficiently if I write a Summary of nearly 1000 columns?

eval(2 :: ncol(dt))
Article Labels

    There are no labels assigned to this post.