News
With Version 5.13 it is enough to write the name of a Parameter into Value. It is recognised by the Filter and easier then the former notation #XI.TIPar( ...
If you want to use a string with the same name please use "quotes".
Summary
This operator allows to filter rows from a table according to conditions on their fields. It roughly corresponds to the WHERE
condition of an SQL statement.
Example: Search for the term "Shop A". All rows containing the string "Shop A" in a given column are selected.
Example: Filter for times related to work
Situation | From the table below only data containing times related to work (starting with "Arbeit" in column D) should be displayed. |
Operation setting | It is possible to filter for more than one criterium, but only one is needed here. |
Result | |
TIS Project |
Simple Filters
| |
| |
In the operations view you can see now the defined filters and number of chosen lines. |
|
User Defined Filters
Filters can also be created manually. |
|
Filter statement |
|
Parameter Controlled Filter Conditions
To filter tables via [TIS]Board and parameters, define filter parameters. |
|
Now define a statement which includes the filter | #XI.TISPar("Filter 1")# == |
Controller portlet | Now make a controller portlet for [TIS]Board, where you can type in the condition for your filter. |
Parameter Controlled Filters for Columns
Create a parameter for defining column names |
|
Now define a statement, which includes the filter | BeginsWith(#XI.TISPar("Column name")#,"A") |
Controller portlet | Now make a controller portlet for [TIS]Board, where you can type in the column for your filter. |
Want to learn more?
grammar XFilter;
options
{
language=CSharp3;
TokenLabelType=CommonToken;
output=AST;
ASTLabelType=CommonTree;
}
tokens
{
OPERATOR;
COMPAREEXPRESSION;
FUNCTIONEXPRESSION;
XIFUNC;
}
@lexer::namespace{xi.OpMisc.Filter}
@parser::namespace{xi.OpMisc.Filter}
/*
* Parser Rules
*/
public
filterfunc : logical_expression EOF!
;
logical_expression
: booleanAndExpression (OPERATOR_OR^ booleanAndExpression )*
;
booleanAndExpression
: compareexpression (OPERATOR_AND^ compareexpression)*
;
function : FUNCTIONIDENTIIFER LBrace comparand (Comma comparand)* RBrace -> ^(FUNCTIONEXPRESSION FUNCTIONIDENTIIFER comparand comparand*)
;
expression : (comparand) operator_comp^ comparand
;
operator_comp
: OPERATOR_COMP_EQ
| OPERATOR_COMP_GT
| OPERATOR_COMP_GE
| OPERATOR_COMP_LT
| OPERATOR_COMP_LE
| OPERATOR_COMP_NE
;
logical_op : OPERATOR_AND
| OPERATOR_OR
;
compareexpression
: (NOT^ )? LBrace! logical_expression RBrace!
| (NOT^ )? function
| (NOT^ )? expression
;
constant
: STRING_LITERAL
| CHARACTER_LITERAL
| FloatString
| Number
| DIGIT
| Boolean
| DateTime
;
comparand : (xIIDENTIFIER_COLUMN|constant);
xIIDENTIFIER_COLUMN
: ICOL0
| XIFUNC
| ICOL1
;
//
/*
* Lexer Rules
*/
XIFUNC_PROLOG
: 'XI.TIS' (LETTER1)+
;
fragment
LETTER1
: 'A'..'Z'
| 'a'..'z'
| DIGIT
| '_'
;
VAL_QUANTIFIER
: 'P'
| 'p'
| 'Z'
| 'z'
;
OPERATOR_COMP_EQ : '==' ;
OPERATOR_COMP_GT : '>' ;
OPERATOR_COMP_GE : '>=' ;
OPERATOR_COMP_LT : '<' ;
OPERATOR_COMP_LE : '<=' ;
OPERATOR_COMP_NE : '!=' ;
OPERATOR_AND
: '&&' | 'and' | 'AND'
;
OPERATOR_OR
: '||' | 'or' | 'OR'
;
protected NOT : '!' | 'not';
fragment
DIGIT : ('0'..'9');
protected FloatString
: '-'? (DIGIT)* '.' (DIGIT)+
;
protected Number: '-'? (DIGIT)+ (VAL_QUANTIFIER)?
;
protected Boolean
: 'true' | 'false' | 'True' | 'False'
;
protected TimePart
: 'T'DIGIT DIGIT? ':' DIGIT DIGIT? ':' DIGIT DIGIT?
;
protected DateTime
: DIGIT DIGIT DIGIT DIGIT '-' DIGIT DIGIT? '-' DIGIT DIGIT? (TimePart)*
;
protected Comma: ',';
protected LBrace: '(';
protected RBrace: ')';
fragment
XIDENTIFIER : '#'
;
fragment
BACKSLASH : '\\'
;
fragment
BLANK : ' '
;
FUNCTIONIDENTIIFER
: ('A'..'Z')(LETTER1)*
;
CHARACTER_LITERAL
: '\'' ( EscapeSequence | ~('\''|BACKSLASH) )* '\''
;
STRING_LITERAL
: '"' ( EscapeSequence | ~(BACKSLASH|'"') )* '"'
;
fragment
ESC_IDENT
: BACKSLASH ( '@' )
;
EscapeSequence
: '\\' ('b'|'t'|'n'|'r'|'\"'|'\''|'\\')
;
Comment : '/*' ( options {greedy=false;} : . )* '*/' {$channel=Hidden;}
;
WS : ( ' '
| '\t'
| '\r'
| '\n'
) {$channel=Hidden;}
;
ICOL0
: ('@' DIGIT+ '@')
;
ICOL1
: '@' ( ESC_IDENT | ~('@') )+ '@'
;
fragment
CONSTANTS
: STRING_LITERAL
| CHARACTER_LITERAL
| DateTime
| Number
| Boolean
| FloatString
| XIFUNC
;
XIFUNC
: (XIDENTIFIER XIFUNC_PROLOG BLANK* '(' BLANK* (CONSTANTS) (BLANK* ',' BLANK* (CONSTANTS))* BLANK* ')' BLANK? XIDENTIFIER)
;
Related topics