Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi
please tell me aboot getfieldselection and how to work.
and how to hide the chart using getfieldselection.
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
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.
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 ![]() |
'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 )
Hi,
Have a look:
Re: Select value for chart by GetFieldSelections()
Re: show hide chart on behalf of list box values
Hope it helps!!