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

Set Analysis - Penetration

Hi Community,

I am attempting a product penetration calculation to accompany a map.  What I would like to happen is when I select a particular state, to have the industry penetration for just that state populate.  Long story short, is there a way to add a modifier to the below expression to only calculate based on the state selected.  Its currently dividing industry within the state by total industry across the country.

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

Hopefully that makes sense.

Thanks

TJ

1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

I am not 100% sure, as I've read above statement, it's the Industry that needs to be modified.

But p() function should / could be the way to go here.

View solution in original post

4 Replies
swuehl
Champion III
Champion III

Maybe like

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

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

sunny_talwar
MVP
MVP

Stefan -

I might be wrong, but shouldn't it be this:

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

swuehl
Champion III
Champion III

I am not 100% sure, as I've read above statement, it's the Industry that needs to be modified.

But p() function should / could be the way to go here.

Not applicable
Author

I was trying to keep the base state static.  This function worked perfectly...

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

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

Thank you to both of you!