Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
ni_avoss
Creator
Creator

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
sunny_talwar

May be use Concat() instead of GetFieldSelections?

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

View solution in original post

13 Replies
sunny_talwar

May be use Concat() instead of GetFieldSelections?

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

ni_avoss
Creator
Creator
Author

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
Creator
Creator
Author

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

sunny_talwar

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

galax_allu
Specialist
Specialist

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

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

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

ni_avoss
Creator
Creator
Author

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 ?

sunny_talwar

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

ni_avoss
Creator
Creator
Author

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

marcus_sommer
MVP & Luminary
MVP & Luminary

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

- Marcus