Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

raceberos
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

ReferenceAmount
1100
2200
3300
4400

does anyone have an idea how to compute it

thanks...

Tags (3)
6 Replies
MVP
MVP

Re: HELP in SUM

Try like:

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

raceberos
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
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
MVP

Re: HELP in SUM

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

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

raceberos
New Contributor III

Re: HELP in SUM

oww sorry for that i posted the wrong formula

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

replace the HSL to Reference.

thanks for that.

MVP
MVP

Re: HELP in SUM

Try the expression I showed above. Positioning of '<=' needs to be corrected.