Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results 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

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://qlikviewcookbook.com

3 Replies

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
MVP

Try a dollar sign expansion

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

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