Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
ni_avoss
New Contributor III

getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

hi there,

in the frontend I want to combine the functions getfieldselections & getselectedcount  to dynamically show fieldselections, based on the number of selections.

the problem: both return different fieldcount.

I found out that getselectedcount has the parameter IncludeExcluded, which defaults to false. If set to true() both functions return the same fieldcount so I guess getfieldselections includes excluded values which is quite confusing.

Is there any way to not include exluded values in getfieldselections() ? Or any different ideas for a workaround?

thanks,

alex

1 Solution

Accepted Solutions

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

May be use Concat() instead of GetFieldSelections?

If(GetSelectedCount() > 0, Concat(DISTINCT FieldName))

11 Replies

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

May be use Concat() instead of GetFieldSelections?

If(GetSelectedCount() > 0, Concat(DISTINCT FieldName))

ni_avoss
New Contributor III

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

well, yeah that might be an idea. the useful parameter in that function was that it automatically switches from concatenation to a summary ("x of y") after hitting MaxValues. But I guess I can rebuild this more or less if there is no other way

thanks

ni_avoss
New Contributor III

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

oh just tried this. concat() also return exluded values, thus will not work

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

Concat() includes excluded values, can you share a sample of what you trying to get?

galax_allu
Valued Contributor

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

=if(Aggr(Sum(1), FIELDNAME)>0,

'Selected: $(=Concat(DISTINCT FIELDNAME, ', '))',

'Others: $(=Concat({<FIELDNAM=E({$})>} DISTINCT FIELDNAME, ', '))')

ni_avoss
New Contributor III

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

let me try to explain:

I got two boxes. One which is a standard listbox, second is a summary of the selection (works similar to text field). Basically I try that both boxes show the same.

The problem: when extending my selection (to other fields), the selection within the listbox shrinks accordingly to what is really shown. Not so in the summary box which uses now the following expression (GetFieldSelections just got replaced with concat):

=if(GetSelectedCount(Channel)=0,'Channel',

    if(GetSelectedCount(Channel)>5,GetSelectedCount(Channel)&' Channels',

            Concat(Channel,', ')))

is that clear ?

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

So you are saying that Concat() is showing Channels which are not selected?

ni_avoss
New Contributor III

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

they have been selected before but further selection excludes values from the initial selection

MVP & Luminary
MVP & Luminary

Re: getfieldselections & getselectedcount return different fieldcount -> IncludeExcluded

I think the best would be if you provide a small example.

- Marcus