Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automatic filter on sheet select

Hi,

i want to create an automatic filter on sheet activating that select only the Top 10 items of a list.

The ranking formula is the following:

=aggr(if(rank(sum(value))<=10,State),State)

How can i realize it?

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

do a button with just rule2 (it should work without pb). Remove $( before aggr

as I told you, I created a variable that is put into the action

Fabrice

What I have and works:

=replace( '(' & concat(aggr(if(rank(sum(montant)) < 10, date_creation), date_creation), '|') &')', ' ', '?')

View solution in original post

7 Replies
sujeetsingh
Master III
Master III

you can set action on close sheet

Not applicable
Author

Try that on OnActivate action, Selection, select in Field

Choose your field: State

And put that in the search string:

replace( '(' & concat($ YourExpression, '|') &')', ' ', '?')

where YourExpression is aggr(if(rank(sum(value))<=10,State),State)

As usual, if you do selection instead of the user, you need to warn it with a textbox or sth similar.

Tell me

Fabrice

Not applicable
Author

Hi Fabrice,

it seems to be a good idea, but it doesn't work.

No filter is applied..

Not applicable
Author

1) Clear field first in action 1  (if not the first 10 will be searched into the current state)

2) in action 2, do not forget the = sign before the replace() function

3) in sum(value), it is also possible to insert a set analysis (or clear specific fields first) because this sum will depend on the current state

But you are right it does not work: a button with this action works, the OnActivate does not work

A workaround:

create a variable with =replace (xxxxx)

and the action becomes ='$(newVariable)'

(do not forget the quotes)

Fabrice

Not applicable
Author

I tried with a button, but it doesn't work yet.

I did the following:

1) create button

2) rule1: "Clear filters in field Stato"

3) rule2: "Set filter in field "Stato"" like this:

=replace( '(' & concat($(aggr(if(rank(sum(Imponibile))<=10,Stato),Stato)), '|') &')', ' ', '?')

Only the first rule works...

Where is the problem?

Not applicable
Author

do a button with just rule2 (it should work without pb). Remove $( before aggr

as I told you, I created a variable that is put into the action

Fabrice

What I have and works:

=replace( '(' & concat(aggr(if(rank(sum(montant)) < 10, date_creation), date_creation), '|') &')', ' ', '?')

Not applicable
Author

Great!

Now it works!