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

How to calculate flu vaccination rate by year month?

Hi Experts,

I am trying to calculate the flu vaccination rates dynamically based upon user's selection in year and month. The flu vaccine is generally given from October to March. When 201608 is selected, the vaccination rate should be 33% (2015-16 season). When 201703 is selected, the vaccination rate should be 75% (2016-17 season). The green, blue and red indicate the different flu seasons. I created a small project for reference.

Thanks

   

idFlushotDateMonthYearMonthvaccinatedRateFlu season
11/4/201612016011100%2015-2016
22/29/20162201602050%2015-2016
38/24/20168201608033%2015-2016
410/13/2016102016101 2016-2017
511/15/2016112016111 2016-2017
612/12/2016122016120 2016-2017
712/23/2016122016121 2016-2017
81/11/201712017010 2016-2017
92/26/201722017021 2016-2017
103/4/201732017031 2016-2017
113/28/20173201703175%2016-2017
124/24/201742017040 2016-2017
136/15/201762017060 2016-2017
146/29/201762017060 2016-2017
157/12/201772017070 2016-2017
168/18/201782017080 2016-2017
179/20/20179201709043%2016-2017
1810/11/2017102017101 2017-2018
1911/12/2017112017110 2017-2018
2012/12/2017122017121 2017-2018
211/2/201812018010 2017-2018
222/2/201822018021 2017-2018
233/3/20183201803167%2017-2018
244/2/201842018040 2017-2018
1 Solution

Accepted Solutions
sunny_talwar

May be this

=num(sum({<YearMonth= {"$(='>=' & Num#(Date(YearStart(Max(Date#(YearMonth, 'YYYYMM')), 0, 10), 'YYYYMM')) & '<=' & Num#(Date(Floor(MonthEnd(Max(Date#(YearMonth, 'YYYYMM')))), 'YYYYMM')))"}, FlushotDate>} vaccinated)

/count({<YearMonth= {"$(='>=' & Num#(Date(YearStart(Max(Date#(YearMonth, 'YYYYMM')), 0, 10), 'YYYYMM')) & '<=' & Num#(Date(Floor(MonthEnd(Max(Date#(YearMonth, 'YYYYMM')))), 'YYYYMM')))"}, FlushotDate>} id), '#,##0.0%')

View solution in original post

4 Replies
sunny_talwar

May be this

=num(sum({<YearMonth= {"$(='>=' & Num#(Date(YearStart(Max(Date#(YearMonth, 'YYYYMM')), 0, 10), 'YYYYMM')) & '<=' & Num#(Date(Floor(MonthEnd(Max(Date#(YearMonth, 'YYYYMM')))), 'YYYYMM')))"}, FlushotDate>} vaccinated)

/count({<YearMonth= {"$(='>=' & Num#(Date(YearStart(Max(Date#(YearMonth, 'YYYYMM')), 0, 10), 'YYYYMM')) & '<=' & Num#(Date(Floor(MonthEnd(Max(Date#(YearMonth, 'YYYYMM')))), 'YYYYMM')))"}, FlushotDate>} id), '#,##0.0%')

baylor2016
Creator
Creator
Author

Could you please provide some explanation? Thanks!!!

sunny_talwar

Key was to get the right range of data.... Check the below in a text box object

='>=' & Num#(Date(YearStart(Max(Date#(YearMonth, 'YYYYMM')), 0, 10), 'YYYYMM')) & '<=' & Num#(Date(Floor(MonthEnd(Max(Date#(YearMonth, 'YYYYMM')))), 'YYYYMM'))

baylor2016
Creator
Creator
Author

Hi Sunny,

Can you help me with this question?

Thanks

Longmatch