Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
cloud
Contributor III
Contributor III

Count of Max Value for Latest Month

Hi Experts,

I have data as below:

MonthNameTypeMonths Overdue
Feb-19JaneA2
Feb-19JaneB2
Feb-19JaneC2
Feb-19TimD1
Feb-19TimE1
Feb-19SallyF1
Jan-19SallyG4
Jan-19JohnH3

 

I want to display in a text box the count of the max value of Months Overdue for the latest month:

"3 types with 2 months overdue"

 

How do I go about doing this? Been stuck on this forever. Please type in example as I can't open Qlikview files. Thank you.

Labels (4)
1 Solution

Accepted Solutions
cloud
Contributor III
Contributor III
Author

I fixed it:

I created a variable vMaxNumMonths, which holds the set expression for latest month and max(Months overdue), and just place it in the set expression.

Thanks all.

View solution in original post

3 Replies
Claudiu_Anghelescu
Specialist
Specialist

Types = Count( {<[Months Overdue]= {"$(=Max([Months Overdue]))"}>} Type )

Months Overdue =max([Months Overdue])

 

=Count( {<[Months Overdue]= {"$(=Max([Months Overdue]))"}>} Type ) & ' types with ' & max([Months Overdue]) & ' months overdue'

 

or you can use Aggr() function.

To help community find solutions, please don't forget to mark as correct.
cloud
Contributor III
Contributor III
Author

Hi Claudiu,
Your solution does not work for me. I do have data for different months. I've updated my post for better understanding. thanks.

Also, I can't open Qlikview files as I'm on Personal Edition. 

cloud
Contributor III
Contributor III
Author

I fixed it:

I created a variable vMaxNumMonths, which holds the set expression for latest month and max(Months overdue), and just place it in the set expression.

Thanks all.