GetCurrentSelections - chart function
GetCurrentSelections() returns the current selections in the app.
If options are used you will need to specify record_sep. To specify a new line set record_sep to chr(13)&chr(10).
If all but two, or all but one, values, are selected, the format 'NOT x,y' or 'NOT y' will be used respectively. If you select all values and the count of all values is greater than max_values, the text ALL will be returned.
Syntax:
GetCurrentSelections ([record_sep [,tag_sep [,value_sep [,max_values]]]])
Return data type: string
Arguments:
Arguments | Description |
---|---|
record_sep | Separator to be put between field records. The default is <CR><LF> meaning a new line. |
tag_sep | Separator to be put between the field name tag and the field values. The default is ': '. |
value_sep | The separator to be put between field values. The default is ', '. |
max_values | The maximum number of field values to be individually listed. When a larger number of values is selected, the format 'x of y values' will be used instead. The default is 6. |
Examples and results:
The following example uses two fields loaded to different filter panes, one for First name name and one for Initials.
Examples | Results |
---|---|
Given that John is selected in First name. GetCurrentSelections () |
'First name: John' |
Given that John and Peter are selected in First name. GetCurrentSelections () |
'First name: John, Peter' |
Given that John is selected in First name and JA is selected in Initials. GetCurrentSelections () |
'First name: John; Peter Initials: JA' |
Given that John is selected in First name and JA is selected in Initials. GetCurrentSelections ( chr(13)&chr(10) , ' = ' ) |
'First name = John Initials = JA' |
Given that you have selected all names except Sue in First name and no selections in Initials. =GetCurrentSelections(chr(13)&chr(10),'=',',',3) |
'First name=NOT Sue' |
Data used in example:
Initials:
LOAD * inline [
"First name"|Initials|"Has cellphone"
John|JA|Yes
Sue|SB|Yes
Mark|MC |No
Peter|PD|No
Jane|JE|Yes
Peter|PF|Yes ] (delimiter is '|');