cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
theo_beluzzi
Level I

Naming subsets in JSL

Hi!

I have a large dt, and want do make subsets from a column. I've managed to do it, but the subsets have all the columns locked. How I can unlock them in the code?

Also, how can I specify it's names, so I can work with those later?

dt2 << (Subset(

                   By( :Filial ),

                           Selected Rows( 0 ),

                           columns( :Cod. Cliente DPK,

                                         :Desc. Município Cadastro,

                                         :Desc. Cliente,

                                         :Desc. Tipo Cliente N1,

                                         :Desc. Tipo Cliente N2,

                                         :Name( "Sum(Vlr. Venda Comercial)" ),

                                         :Name( "Sum(Vlr. Lucro Bruto)" ),

                                         :Mg Bruta

  )));

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp
Staff

Re: Naming subsets in JSL

Depending on what you want to happen next, there may be a better way to do what you have in mind (maybe using a data filter instance). But, if you want or need to use 'subset', try something like:

Names Default To Here( 1 );

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dts = dt << subset(By(:sex), Columns(:name, :age)); // Using 'By' makes a subset table for each level in the hspecified column. 'dts' is a list of associated table references

// Change the names of the subset tables

dts[1] << setName("Females");

dts[2] << setName("Males");

View solution in original post

2 REPLIES 2
ian_jmp
Staff

Re: Naming subsets in JSL

Depending on what you want to happen next, there may be a better way to do what you have in mind (maybe using a data filter instance). But, if you want or need to use 'subset', try something like:

Names Default To Here( 1 );

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dts = dt << subset(By(:sex), Columns(:name, :age)); // Using 'By' makes a subset table for each level in the hspecified column. 'dts' is a list of associated table references

// Change the names of the subset tables

dts[1] << setName("Females");

dts[2] << setName("Males");

theo_beluzzi
Level I

Re: Naming subsets in JSL

Ooh, that's great!

I just want to break the original dt in others, and work with each in different ways... That's the best way of doing the separation?

Another question: when working with each of the subsetted tables, how i specify them? By dts1, dts2, etc.? Or I can also determine that?