Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
gkcchowdary
Creator
Creator

explain about getfieldselection?

hi

please tell me aboot getfieldselection and how to work.

and how to hide the chart using getfieldselection.

5 Replies
PrashantSangle

Hi,

explanation from help menu

getfieldselections ( FieldName [, ValueSep [, MaxValues]])

Returns a string with the current selections in a field.

ValueSep is the separator to be put between field
values. The default is ', '.

Maxvalues is 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

getfieldselections ( Year )

getfieldselections ( Year, '; ' )

getfieldselections ( Year, '; ' , 10 )

-------------------------------------------------------------------------------------------------------

Since It suggest it will return selected value

so that in chart Property - > Layout ->Show ->conditonal -> you can write your expression for hide and show

for example

if(getfieldSeletctions(ProductName)='TV',1,0)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
prma7799
Master III
Master III

tresesco
MVP
MVP

Did you check the Help (press F1 after opening the qv desktop)?  GetFieldSelections() returns a string that lists current selections in a field(that is passed as a parameter in the function). If nothing is selected, it returns '-'. Now you can think of a condition, if nothing of a field is selected, you want to hide a chart, there you can write an expression like: =IsNull(GetFieldSelections(FieldName))
However, generally GetSelectedCount() is a better option for such purpose. Nevertheless, this function has it's own importance on different requirements.

avinashelite

getcurrentfield (GroupName)

Returns the name of the currently active field in a group.

Example

getcurrentfield( myGroup )

getfieldselections ( FieldName [, ValueSep [, MaxValues [, State]]])

Returns a string with the current selections in a field. It is possible to query an alternate state.

ValueSep is the separator to be put between field values. The default is ', '.

Maxvalues is 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.

State is the alternate state to query.

The string that is returned can be in these forms:

   

'x, y,z'If the number of selected values is Maxvalues or less, the string returned is a list of the selected values, separated with Valuesep as delimiter.
'NOT x, y, z'If the number of non-selected values is Maxvalues or less, the string returned is a list of the non-selected values, separated with ValueSep as delimiter, and NOT as a prefix.
'x of y'If the number of selected values is more than Maxvalues, but less than the total number of values (y) less Maxvalues.
'ALL'If all values are selected.
'-'If no value is selected.
<search string>If you have selected using search, the search string is returned.

Examples

getfieldselections ( Year )

getfieldselections ( Year, '; ' )

getfieldselections ( Year, '; ' , 10 )

getcurrentselections ([RecordSep [, TagSep [,ValueSep [, MaxValues [, State]]]]])

Returns a string with the current selections in the document. It is possible to query an alternate state.

RecordSep is the separator to be put between field records. The default is <CR><LF>.

TagSep is the separator to be put between the field name tag and the field values. The default is ': '.

ValueSep is the separator to be put between field values. The default is ', '.

Maxvalues is 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.

State is the alternate state to query.

Examples

getcurrentselections ( )

getcurrentselections ( chr(13)&chr(10) , ' = ' )

getcurrentselections ( chr(13)&chr(10) , ' : ' , ' ; ' )

getcurrentselections ( chr(13)&chr(10) , ' : ' , ' ; ' , 10 )

Anonymous
Not applicable