Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dates in set analysis

Hi All,

I have requirement where in I have to get the count of  a dimesion w.r.t to one date based on the selection of a different date dimension

Please find the sample data

Customer    Effective dateExpiration date
A6/1/20176/1/2018
B7/2/20177/2/2018
C6/3/20176/3/2018
D8/4/20178/4/2018
E8/5/20168/5/2017
F8/5/20178/5/2018
G8/12/20178/12/2018

now we have the month and year filter selections based on effective date.

So the requirement is when we click on effective date we should get count of how many customers are having effective date as well as how are expiring.

for eg: if we click on Aug 2017 we should get count as 1 as we have customer E expiring in aug 2017 and another test box with count of customers having aug 2017 as effective date which will 3

Month and year filter based on effective dates.

So we have two text boxes



Count of customers expiring                                   count of customer effective

Kindly let me know if requirement is unclear

Thanks,

anupama jagan

7 Replies
maxgro
MVP
MVP

Look at the attachment

1.png

Anonymous
Not applicable
Author

Thanks a lot for your solution. It works great !!. Just a small doubt Is it possible to show count(customer) effective (in expiring customers text box) when no selections are made?

maxgro
MVP
MVP

You can use the max function to count the customer of the max year and max month.

count({$ <eff_year=,eff_month=,eff_date=,exp_date={">=$(=date(monthstart(makedate(max(eff_year),max(eff_month)))))<=$(=date(monthend(makedate(max(eff_year),max(eff_month)))))"}>} DISTINCT customer)

count({$ <eff_year=,eff_month=,eff_date={">=$(=date(monthstart(makedate(max(eff_year),max(eff_month)))))<=$(=date(monthend(makedate(max(eff_year),max(eff_month)))))"}>} DISTINCT customer)

mariusz_kumansk
Contributor III
Contributor III

HI, Like this? you should think about creating Master Calendar in your application.

customers.png

Anonymous
Not applicable
Author

Hi Massimo,

Is it possible to get ytd and qtd for this?

count({$ <eff_year=,eff_month=,eff_date=,exp_date={">=$(=date(monthstart(makedate(max(eff_year),max(eff_month)))))<=$(=date(monthend(makedate(max(eff_year),max(eff_month)))))"}>} DISTINCT customer)

maxgro
MVP
MVP

try wity

yearstart or quarterstart

today - 1

Anonymous
Not applicable
Author

Hi Massimo,

the expression is working well when we select single year and month, is it possible to extend this one for multiple selections?