Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
TheMdu
Contributor III
Contributor III

Set Analysis Count if

Hi

I have a countif expression where I want to count number of clients, but I want it to be fixed to a certain month. The current expression is :

count(if(InceptionDate,pkPolicyNumber))

 

I want this to be fixed to '2019-03-01', which is the inception date on a pie chart.

 

My Set analysis foundation is a bit shaky 🙂

6 Replies
dplr-rn
Partner - Master III
Partner - Master III

try

Count( {<InceptionDate={'=$(=MakeDate(2019,3,1))'}>} ipkPolicyNumber)

not sure what you mean by inception date on a pie chart.
you can move the makedate piece into a variable to make it more generic if needed
TheMdu
Contributor III
Contributor III
Author

I have 2 charts, one is a line graph correctly showing info over a longer period. The pie chart needs to show current month - 1, which is 2019/03/01.

I tried your code and it’s returning errors. Thanks
dplr-rn
Partner - Master III
Partner - Master III

if it always current month -1 put that logic there instead of the hard coded make date

whats the error. that code should work. similar format works in my dummy dashboard locally
TheMdu
Contributor III
Contributor III
Author

Apologies, the script does work. The idea is for the object (pie chart) to remain on 2019-03-01, even when I select a different date. With the script you provided the pie chart changes with every date selection

Wilson_Webb
Partner - Contributor II
Partner - Contributor II

it should work. Just a little syntax change...

 

Initial expression: Count( {<InceptionDate={'=$(=MakeDate(2019,3,1))'}>} ipkPolicyNumber)

 

Revised Expression: Count( {<InceptionDate={'=Date(MakeDate(2019,3,1),'YYYY-MM-DD')'}>} ipkPolicyNumber)

dplr-rn
Partner - Master III
Partner - Master III

Share exact expression you used and the which filters are affecting it.
Date filter (full date selection on inception date) should not effect it. But if you have month and year filters it might be affected.
Share details and we can try and modify it.