Data Filter only by columns that are of type 'character'col_name_list_character=dt << Get Column Names("Character");
// would like (if possible) to only filter by columns of type <EM>character</EM>.
// Same as filtering by col_name_list_character above
//
Button Box( " Activate Filter ", dfilter = dt << data filter( Mode( Show( 1 ), Include( 1 ) ), add filter() ) ),
//
// right now, the filter box has all columns (numeric and character)I am having a hard time figuring out how to create a data filter within my application that ONLY filters by columns of type 'character'. A small portion of my code is attached. Seems like this one should be easy, but I'm obviously missing something. Any help is appreciated!
Re: Data Filter only by columns that are of type 'character'You're very welcome!Re: Data Filter only by columns that are of type 'character'That works great! Thank you so much.
Re: Data Filter only by columns that are of type 'character'Hi @Jim_G_Pappas
Try this:
Button Box( " Activate Filter ",
dfilter = dt << data filter( Mode( Show( 1 ), Include( 1 ) ), add filter() );
colObjList = {};
For( i=1, i<=NItems(col_name_list_chacter), i++,
InsertInto(colObjList, Column(col_name_list_chacter[i]) );
);
Eval(EvalExpr( dfilter << columns( Expr(colObjList) ) ) );
dfilter << Display( Single Category Display );
);
Note the "global" application of the option as you correctly described is achieved by apply the << Display( Single Category Display ) to the Data Filter Object, rather than each column
Re: Data Filter only by columns that are of type 'character'That works great - I really appreciate the response!
The only issue is that all the options / levels are showing for each column. So the filter list goes way off the bottom of the page. I can manually solve this AFTER the filter shows up on the screen (Display Options > Single Category Display) but am having difficulty adding this to the code. I can do this for each column (ex. Display( :Operator, Single Category Display ) but don't know how to "globally" do this on each column since the columns change from dataset to dataset.
Any advice on that one?
Re: Data Filter only by columns that are of type 'character'@Jim_G_Pappas
Try adding:
Button Box( " Activate Filter ",
dfilter = dt << data filter( Mode( Show( 1 ), Include( 1 ) ), add filter() );
colObjList = {};
For( i=1, i<=NItems(col_name_list_chacter), i++,
InsertInto(colObjList, Column(col_name_list_chacter[i]) );
);
Eval(EvalExpr( dfilter << columns( Expr(colObjList) ) ) );
);