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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Zyrotot
Contributor
Contributor

Finding the highest value for an expression

So, I have two sets of data, in one I have the population of each state, and in the other one the information about each scholarship given (in the information includes the state of the school).

Is there a way for me to separate the number of scholarships given per state, and calculate the highest scholarship per capita?

Or I need to calculate each per capita manually?

 

Example tables:

Population table

StatePopulation
State15.568.245
State2458.659
State31.569.123

 

 

Scholarship table

 

IDYearSchool...State
12010XXX...State1
22010XXX...State2
32010XXX...State3
...............
548962010XXX...State2

 

3 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Zyrotot,

Your tables should be linked based on the State. That makes it possible to measure this.

Sum(Population) / Count(Distinct ID)

Jordy

Climber

Work smarter, not harder
Zyrotot
Contributor
Contributor
Author

They are linked, but this would only give me the country per capita, no?

I wanted the highest state per capita, like it automatically returns the per capita from state X, which is the highest one.

Vegar
MVP
MVP

Could this solve your problem?

If(Sum(Population)/Count(Distinct ID) =Max(TOTAL Aggr(Sum(Population)/Count(Distinct ID), State)), Sum(Population)/Count(Distinct ID))