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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
bjdouglas
Contributor II
Contributor II

Creating a measure with set analysis off another measure with different set analysis criteria.

I'm trying to base a measure with set analysis criteria off another measure that has a different set analysis criteria. Here's the measure (Policy Count) I want to base it on. I don't want the measure(Policy Count) created in the script.

 

Policy Count
count({<RecType={'Current'},[Counting Policy]={"=sum(cumulative_UEP)>0"}>}distinct [Counting Policy])

Below is the measure I'm trying to create.

Client Count

count({<RecType={'Current'},[Client No]={"=sum([Policy Count])>0"}>}distinct [Client No])

Any ideas on how I could accomplish that? 

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Just this 

 

Client Count

count({<RecType={'Current'}, [Client No]={"=sum(cumulative_UEP)>0"} >}distinct [Client No])

Or

count({<RecType={'Current'}, [Counting Policy]={"=sum(cumulative_UEP)>0"} >}distinct [Client No])

 

by definition, PolicyCount  =  any policy that has sum(cumulative_UEP)>0

so ClientCount = Client with PolicyCount > 0 

; which in turn also means clients with  sum(cumulative_UEP)>0 !!!

 

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

View solution in original post

6 Replies
Gabbar
Specialist
Specialist

There is a slight problem here:- you cannot use cumulative measure without aggregating.
Your Policy Count is Already a count function thus you cannot use sum on it.

First Try this:-
count({<RecType={'Current'},[Client No]={"=(([Policy Count])>0)"}>}distinct [Client No])
(Please Try to replace this with expression of meaure or variable and not Master measure)

If that doesnt work, create a new measure by aggregrating policy count on Client No and then using sum like:-
NewM = aggr([Policy Count],[Client No])
count({<RecType={'Current'},[Client No]={"=(Sum(NewM)>0)"}>}distinct [Client No])
(Same as above use as Complete expression or use Variable)

If both of these doesnt work please share sample data and sample output and explain using those two.

bjdouglas
Contributor II
Contributor II
Author

Thanks for the reply this doesn't solve my issue. I'm trying an alternative that I believe will work for me. I just need to test it out.  If it works I'll post it. Thanks again.

jochem_zw
Employee
Employee

Make the policy count a master item and use this masteritem in your expression 

count({<RecType={'Current'},[Client No]={"=[Policy Count]>0"}>}distinct [Client No])

 

Chanty4u
MVP
MVP

Try this 

SET vPolicyCount = count({<RecType={'Current'},[Counting Policy]={"=sum(cumulative_UEP)>0"}>}distinct [Counting Policy]);

Client Count

count({<RecType={'Current'},[Client No]={"=$(vPolicyCount)>0"}>}distinct [Client No]

)

vinieme12
Champion III
Champion III

Just this 

 

Client Count

count({<RecType={'Current'}, [Client No]={"=sum(cumulative_UEP)>0"} >}distinct [Client No])

Or

count({<RecType={'Current'}, [Counting Policy]={"=sum(cumulative_UEP)>0"} >}distinct [Client No])

 

by definition, PolicyCount  =  any policy that has sum(cumulative_UEP)>0

so ClientCount = Client with PolicyCount > 0 

; which in turn also means clients with  sum(cumulative_UEP)>0 !!!

 

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

@bjdouglas 

Create a variable to store policy count output. and use this variable in client count expression

=count({<RecType={'Current'},[Client No]={'$(=$(vPolicyCount))>0'}>}distinct [Client No])

Regards,

Aditya