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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead 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
sunny_talwar
MVP
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.

Thanks again for your help.

TJ