# App Development

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for
Did you mean:
Not applicable

## Penetration Analysis

Hello All,

You guys were able to help me with a similar question, but the approach doesn't seem to work in this instance.

I am working on a % share analysis for products.  I am trying to use my filter selection (Billing State/Province) to then only show the penetration of each product within that selected state.  Here is my current expression...

count(distinct {<Lost={'N'},TotalActiveEmployeesClient=-{'=Len(Trim(TotalActiveEmployeesClient))=0'}>}[ClientNumber])/

count(distinct {1<Lost={'N'},TotalActiveEmployeesClient=-{'=Len(Trim(TotalActiveEmployeesClient))=0'},[Billing State/Province] = p()>}[ClientNumber])

I might not need the p() clause?.?.  Would this utilize the 'getselectedfields' modifier?

Any help is appreciated.

TJ

3 Replies
MVP

What you have should work, unless there is more to the chart then we are seeing here. Alternatively, you can try this:

Count(distinct {<Lost={'N'},TotalActiveEmployeesClient=-{'=Len(Trim(TotalActiveEmployeesClient))=0'}>}[ClientNumber])/

Count(distinct {1<Lost={'N'},TotalActiveEmployeesClient=-{'=Len(Trim(TotalActiveEmployeesClient))=0'}, [Billing State/Province] = \$::[Billing State/Province]>}[ClientNumber])

Not applicable
Author

Thanks Sunny, the numerator and denominator are unfortunately returning the same values.

Not applicable
Author

I actually figured it out...

count(distinct {<Lost={'N'},TotalActiveEmployeesClient=-{'=Len(Trim(TotalActiveEmployeesClient))=0'}>}[ClientNumber])/count(total distinct {\$<Lost={'N'},TotalActiveEmployeesClient=-{'=Len(Trim(TotalActiveEmployeesClient))=0'}>}[ClientNumber])

I think it was I had a '1' identifier instead of  a '\$' in the denominator.