Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Select all values with a button based on expressions

Hi all,

I have a bar chart wherein I have the following dimension:

=aggr(Count(usersubscription.id), profile.id)

and I use the following expression to exclude those profiles that have more than 1 usersubscription:

=if(aggr(count(usersubscription.id), profile.id) > 1, count(distinct usersubscription.id))

Now I want a button that is able to select all values from that bar chart. Is this possible to do this through Actions - > 'Select in Field'?

Thanks in advance!

Byron

Tags (4)
1 Solution

Accepted Solutions
Not applicable

Re: Select all values with a button based on expressions

I found the answer.

Action > Toggle Select

Field:

profile.id

Search String:

='=if(aggr(count(user_subscription.id), profile.id) > 1, count(distinct user_subscription.id))'

(So my original expression had to be put between quotes with a '=' in front and the '=' had to be removed in the Field box.)

6 Replies

Re: Select all values with a button based on expressions

You would need to use the Actions > Toggle Select to select more than one value at a time.  (For example, if you want to select A and B, your Select String would need to be (A|B)).  So you would need to use something like:

=if(aggr(count(usersubscription.id), profile.id) > 1, '(' & concat(distinct profile.id, '|') & ')')

Not applicable

Re: Select all values with a button based on expressions

nicole_kowalsky wrote:

You would need to use the Actions > Toggle Select to select more than one value at a time.  (For example, if you want to select A and B, your Select String would need to be (A|B)).  So you would need to use something like:

=if(aggr(count(usersubscription.id), profile.id) > 1, '(' & concat(distinct profile.id, '|') & ')')

Thanks for the reply, but what I did was Actions > Toggle Select:

Field:

=usersubscription_id

Search String:

=if(aggr(count(usersubscription.id), profile.id) > 1, '(' & concat(distinct profile.id, '|') & ')')

However without succes. Must I not fill in more than 1 fieldname in 'Field', or am I doing some else wrong?

Re: Select all values with a button based on expressions

You cannot have a '=' in Field.  You need to just put the field name that you want changed.

Not applicable

Re: Select all values with a button based on expressions

I found the answer.

Action > Toggle Select

Field:

profile.id

Search String:

='=if(aggr(count(user_subscription.id), profile.id) > 1, count(distinct user_subscription.id))'

(So my original expression had to be put between quotes with a '=' in front and the '=' had to be removed in the Field box.)

natebrunner
New Contributor II

Re: Select all values with a button based on expressions

I tried this for something similar and it worked. But I don't really get why? How is it working with that second Count Distinct? If the first part of the "IF" is satisfied, you then are counting Distinct User_Subsription_ID. Don't you need to instead put in a list of user_susbscription_ids? Doesn't your expression place a number into the toggle select?  I'm just a bit confused on how it's actually working.

drksk8tr66
New Contributor

Re: Select all values with a button based on expressions

This will actually show the list of profile.id in the current selections as opposed to showing the expression string. Very useful for display purposes...

Community Browser