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

Get values of a dimension for a current selection

I am trying to access the values for a specific dimension for the current selection so that I can include them in an expression. I have come across GetFieldSelections but I think this only returns values for a dimension if it is actually used in the selection itself.

I need to do this for the following use case:

I have salespeople assigned to teams within an office which in turn is assigned to a region. If I select a region and and then a sales team I would like to return the following in a table/chart (example numbers):

1) Number of salespeople in team selected = 6

2) Number of salespeople in region (for team selected) = 125

3) Number of salespeople in office (for team selected) = 30

1) is simply count(distinct salesperson_id)

2) can be obtained by using GetFieldSelections as the field region was used in the selection 

3)  is my challenge as I want to retrieve the offices that are part of the selected region (or alternatively put the offices for the region that the team ultimately selected belongs to).

Any pointers very welcome!

Can I use the P() operator?

12 Replies
swuehl
MVP
MVP

Count({1<office=p() >} DISTINCT salesperson_ID)

Not applicable
Author

You superstar - that is spot on!!

vinieme12
Champion III
Champion III

yes , mostly the field that you will be making selections on,

please note adding  {1<  will ignore all selections

http://help.qlik.com/en-US/qlikview/12.1/Subsystems/Client/Content/ChartFunctions/SetAnalysis/set-mo...

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.