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

Calculate expression for max value of another expression

Hello,

I have an issue where I want an expression to calculate for only the max value of another expression.

For example, 

I have a sum of costs for each team, which group into departments.  I want to show EBDIT for the department, but only on the team with the highest cost.

DepartmentTeamsum(cost)sum(EBDIT)
ITHelpdesk1239940000
ITBI2311-
ITETL8790-

Is it possible to do this?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

if(sum(cost)=max(total aggr(sum(cost),Department,Team)),sum(EBDIT))

View solution in original post

6 Replies
sunny_talwar

May be this:

If(Rank(Sum(cost)) = 1, Sum(EBDIT))

Anonymous
Not applicable
Author

if(sum(cost)=max(total aggr(sum(cost),Department,Team)),sum(EBDIT))

Anonymous
Not applicable
Author

This works, thank you so much Robin!

sunny_talwar

Didn't realize that there are two dimensions, but this should also work:

If(Rank(TOTAL Sum(cost)) = 1, Sum(EBDIT))

Anonymous
Not applicable
Author

This works as well, thank you Sunny!

sunny_talwar