Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

mrbalyaqv
New Contributor II

GetSelectedCount() for master dimension

Hi all!

I'm trying to achieve following:
- before any selection made, in table there's no fields shown, only totals for measures;
- when user selects some fields from a list, these fields would be displayed in table.
When I use a data field for this 'fields list' all works just fine, but on selection bar real field name is displayed:
1.PNG

I'd want change displayed fields name on selection bar, because the real name could have a realy 'ugly' and not user-friendly name. For this purpose I created a master dimension. And now after selection from this dimension I see its name on selection bar, but displaying of selected columns doesn't work:
2.PNG

I guess, this happens because after selection in master dimension QS makes not same selection in initial field. If I understand correctly, GetSelectedCount() works only for expressions, that reurn field.

I thought about using GetPossibleCount() instead, but I don't know how to determine if it 0 or all values are selected in master dimension.

So, my question is: is it even possible to make selection in master dimenssion and count number of selected values? 

Sample qvf-file attached.

1 Solution

Accepted Solutions

Re: GetSelectedCount() for master dimension

This is not perfect, but you can try this

=Count(DISTINCT [_f_pivot_dim]) > 0 and SubStringCount(Concat(_f_pivot_dim, '|'), 'Name') > 0

When nothing is selected, this will show all three dimensions.

2 Replies

Re: GetSelectedCount() for master dimension

This is not perfect, but you can try this

=Count(DISTINCT [_f_pivot_dim]) > 0 and SubStringCount(Concat(_f_pivot_dim, '|'), 'Name') > 0

When nothing is selected, this will show all three dimensions.

mrbalyaqv
New Contributor II

Re: GetSelectedCount() for master dimension

Well, it's not exactly what I tried to do, but I can deal with it. Thank you!