Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Aggregate into a Button field

Hi All,

I'm trying to use a calculated expression into a button, I am now putting this:


=aggr(count(distinct [Don - Key]),[Pers - Code])

into the field and

=2

as search string.

It's not working, so I'm not sure. Can I use an expression into the Field? What am I doing wrong?

Thank you for your help,

Diego

13 Replies
Not applicable
Author

Thank you so much for your patience Manuel,

in attach an example of what I'm doing (this one has informations from an excel to do it faster, in the real one I am connected to a database).

Inside you can find:

- a table of people

- a table of actions, linked to people

- a list of aggregated actions

- 4 buttons (it's just an example)

What I am missing right now is to have the buttons working on this field I am calculating (if I press 2 in aggregate, I have people with 2 actions, 3 people with 3 actions etc).

Also, I cannot modify and put the aggregation in the script because I need to have it changing depending on the selecions I am doing.

Thanks again

Diego

Anonymous
Not applicable
Author

Hi Diego,

With your example is more clear that you want to do.

1.- On each button create one action to Select Field

2.- On Field write your field [Pers  - Code]

3.- On respect button write this:

  • For 1 action: ='('&Concat({<[Don - Key]={"=aggr(count(distinct [Don - Key]), [Pers  - Code])=1"}>} Distinct [Pers  - Code],'|')&')'
  • For 2 actions:='('&Concat({<[Don - Key]={"=aggr(count(distinct [Don - Key]), [Pers  - Code])=2"}>} Distinct [Pers  - Code],'|')&')'
  • For 3 action2:='('&Concat({<[Don - Key]={"=aggr(count(distinct [Don - Key]), [Pers  - Code])=3"}>} Distinct [Pers  - Code],'|')&')'
  • For 4 actions:='('&Concat({<[Don - Key]={"=aggr(count(distinct [Don - Key]), [Pers  - Code])=4"}>} Distinct [Pers  - Code],'|')&')'

This expression returns an string with the values of Pers-Code concatenated, and separated by | (qlikview standard for select more than one value) on Don-Key (calculated by =aggr(count(distinct [Don - Key]), [Pers  - Code])) are 1, 2, 3 or 4.

Regards!!

Not applicable
Author

Thank you!!!!!

Anonymous
Not applicable
Author

You're wellcome