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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Choose a value based on a deselected field

Hi,

I'm trying to make a chart where the user chooses a name and what is shown in the chart is not the data for the single person that is chosen but the total for the group that the name correlates to.

This is a very simplified example of the table:

Name Group Sales

Daniel A 10

Sara A 15

Peter B 20

This is the expression as it looks now:

Count ({$<Name=, Group={'A'}>} Sales)

Instead of 'A' i want it to dynamically choose the correct group.

Help with this will be much appreciated!



14 Replies
Not applicable
Author

Thank you for your patience!

It still doesnt work.

I have attached a new version of the example file where I have created the same problem as I have in my original file.

If you or anyone else can have a look at it I would be extremely grateful!



IAMDV
Master II
Master II

Daniel - Very sorry! I should have been more clear. I had looked in to your example and please use this expression for field (Not Variable). I had tested this one and it works fine.

=SUM ({$<Name, Group={'$(=(Group))'}>} Sales)

Cheers - DV

IAMDV
Master II
Master II

Daniel - Use this expression if you are using a variable...

=SUM ({$<Name, Group={'$(=(Group))'}>} Sales)

Also please remove the equal to (=) in the variable overview window while declaring the variable. I mean your definition of the variable should be

Only(Group)

and not

=Only(Group)

I hope this should suffice the requirement.

Good luck and let me know if you need any further help!

Cheers - DV

Not applicable
Author

Deepak, thank you so much!

It works great.

I must also say that this is the best forum I've ever been on, everybody is so helpful! Hopefully, soon I'll be able to contribute as well (trying to get my boss to send me to QlikTechs facilities in Lund for some training)

IAMDV
Master II
Master II

Daniel - You are most welcome. I am glad it worked! I had the same problem last month and got it fixed after spending 2 hours on this kind of expression. Yes, this is the best place to share knowledge and I am happy to be here.

Thanks for the points 🙂