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

sum(A) where B = Max(B)

If I replace Max(B) with the maximum value of B in the following line.

Sum({$<B={Max(B)}>}A)

It Works as desired but the Max value of B can change and it is not practical to update manually

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you only need to consider one value for max(B), you can do


Sum({$<B={$(=Max(B))}>}A)


If you need a different max(B) for each dimension row, you'll need to code it as:

Sum(If(B=aggr(max(B), dimension), A)

where dimension is the chart dimension(s)

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

View solution in original post

3 Replies
Anil_Babu_Samineni

If you want to make consultant for irrespect of filters you need {1}

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
swuehl
MVP
MVP

Try a dollar sign expansion

Sum({$<B={$(=Max(B))}>}A)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you only need to consider one value for max(B), you can do


Sum({$<B={$(=Max(B))}>}A)


If you need a different max(B) for each dimension row, you'll need to code it as:

Sum(If(B=aggr(max(B), dimension), A)

where dimension is the chart dimension(s)

-Rob

http://masterssummit.com

http://qlikviewcookbook.com