# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor III

## HELP in SUM

Good day to all

i got this data,

what i want to do is if i filter the Reference to 2 and the

sum of amount must be 300 coz of reference 1+2 = Amount 100+200

i use this formula  " Sum({<Reference={"<=\$(=Max(Reference))"}>}[Amount]) "

i got it right if i select in the filter 1 and 2 but it doest work if i select in the filter only the 2

 Reference Amount 1 100 2 200 3 300 4 400

does anyone have an idea how to compute it

thanks...

Tags (3)
6 Replies
MVP

## Re: HELP in SUM

Try like:

Sum({<Reference, HSL={"\$(=Max(Reference))"}>}[Amount])

New Contributor III

## Re: HELP in SUM

Hi there mate thanks for the help but it doesn't work as expected you coz if i filter the referece it always give me 1000 as sum of amount...

Thanks

MVP

## Re: HELP in SUM

Do you need to check it in the chart or in KPI object? And I don't see a field called HSL ?

MVP

## Re: HELP in SUM

I guess if it is the same field Reference, you could try:

Sum({<Reference={"<=\$(=Max(Reference))"}>}[Amount])

New Contributor III

## Re: HELP in SUM

oww sorry for that i posted the wrong formula