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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
michealjohn
Contributor
Contributor

Min and Max with Count

Hi,

I am newbie to Qlikview and facing issue in getting the result. Below is the sample data.

Org_Code, year

AA, 2014
AA, 2015
AA, 2015
AA, 2016
AA, 2017

BB, 2001
BB, 2019
BB, 2018
BB, 2001

CC, 2002
CC, 2003

I need the total count of org_code with max and min org_code.
For example, total count of AA is 5, BB is 4, CC is 2
The result I want is;

Expected Result:
Max Org_Code --> AA - 5
Min Org_code --> CC - 2


Ppease help on how to have the dimension and expression for it in qlikview

1 Solution

Accepted Solutions
Taoufiq_Zarra

Hi,

Welcome to Qlik!
attached a qlikview file with the formulas or here they are

 

 

='Max Org_Code --> '&FirstSortedValue(Org_Code,-(Aggr(Count(year),Org_Code)))&'-'&Max(Aggr(Count(year),Org_Code))

 

 

 

='Max Org_Code --> '&FirstSortedValue(Org_Code,(Aggr(Count(year),Org_Code)))&'-'&Min(Aggr(Count(year),Org_Code))

 

 

 

Capture.PNG

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

6 Replies
Taoufiq_Zarra

Hi,

Welcome to Qlik!
attached a qlikview file with the formulas or here they are

 

 

='Max Org_Code --> '&FirstSortedValue(Org_Code,-(Aggr(Count(year),Org_Code)))&'-'&Max(Aggr(Count(year),Org_Code))

 

 

 

='Max Org_Code --> '&FirstSortedValue(Org_Code,(Aggr(Count(year),Org_Code)))&'-'&Min(Aggr(Count(year),Org_Code))

 

 

 

Capture.PNG

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Taoufiq_Zarra

thanks @sunny_talwar 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
sunny_talwar

🙂

michealjohn
Contributor
Contributor
Author

thanks a lot for your help. Let me check on it and confirm you as I am having some issue in loading this .qvw file.

michealjohn
Contributor
Contributor
Author

working fine as expected..thanks a lot for your help. Let me try to run with my data lake.. 🙂

Taoufiq_Zarra

Awesome, can you accept in this case the right solution 😁

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉