cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Naming subsets in JSL

theo_beluzzi
Level I

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
Level X


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
Level X


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?