Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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:
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!!
For select in field action? I doubt. What exactly are you trying to do? Select Pers - Code where Count(DISTINCT [Don - Key]) = 2?
Hi Diego,
On field, you have to return the name of a field, and on expression the value. What do you wanna do with this button?
Which action are you using?
Regards!
I'll try to explain
I have a database with people ([Pers - Code] is the code) and they are doing actions that I store in a different table ([Don - Key] is the key of this actions).
I'd like to create a button that give me the possibility to choose people that do a number of actions (2 is just an example) in the current set of selections (so I can't do it in the script).
Using " aggr(count(distinct [Don - Key]),[Pers - Code]) " I can have the number of actions for each people, but I can't create a button to do selections on this
I'll try to explain
I have a database with people ([Pers - Code] is the code) and they are doing actions that I store in a different table ([Don - Key] is the key of this actions).
I'd like to create a button that give me the possibility to choose people that do a number of actions (2 is just an example) in the current set of selections (so I can't do it in the script).
Using " aggr(count(distinct [Don - Key]),[Pers - Code]) " I can have the number of actions for each people, but I can't create a button to do selections on this
Hi Diego,
Create a variable:
vVar = Concat(Distinct [Don - Key],',')
Now, edit your button action:
On field put [Pers - Code].
On expression put: '('&Concat({<[Don - Key]={$(vVar)}>} Distinct [Pers - Code],'|')&')'
Regards!
Sorry for the dumb question, I'm trying but it seems not working to me.. Where do I say that if I push the button I select the value 2, 3 or a different one?
Kind regards
Diego
Hi Diego, with my code you select the people who has the keys selected. If you want to do it with static numbers, you don't need the variable.
'('&Concat({<[Don - Key]={2}>} Distinct [Pers - Code],'|')&')'
Regards!!
Thank you for your help, I'm still not able to make it works but I'm trying to understand why, probably I just need to study better the Set analysis statement.
From what I can read in your, you expect to find a [Don - Key] equals to 2, is it correct? If yes, it can't works for me because I need to count the keys for each person and select the people who have a number of action equals to 2
Please, attach one example of your app, plz.