Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

RangeSum

Hello,

I have next example

First column weeknr

Second column number

Third column RangeSum

52     100     100

51     150     250

50     300     550

49     100     650

48     400     1050

etc.

I Have for third column next formula: RangeSum(Above(sum(BRUTO),0,rowno()))

But I want to have next output

52     100     1050

51     150     950

50     300     800

49     100     550

48     400     400

etc.

Also RangeSum in Reverse Order from what i now have.

Weeknrs. should be in order as in example.

Who can help me?

Thx.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

This also works:

=RangeSum(Below(Sum(BRUTO), 0, NoOfRows()+1-RowNo()))

Note that the names of Above and Below point to the visual orientation, not the effective RowNo-related order in your "table" object.

View solution in original post

8 Replies
preminqlik
Specialist II
Specialist II

hi try below one

i think you are doing in UI,

take 3rd expression as 

=$(=sum(BRUTO))-RangeSum(Above(sum(BRUTO),0,rowno()))

sushil353
Master II
Master II

Hi,

You can also try below expression:

if(RowNo()=1,sum(TOTAL number),Above(test)-Above(number))

Here test is the expression name.. change accordinbly .. sorting is done descending on weeknr..

HTH

Sushil

Not applicable
Author

Thx for helping me, but doesn't work.

Not applicable
Author

Thx for helping me, but doesn't work.

tresesco
MVP
MVP

If you just want the reverse of a calculated column, try like:

=Below(YourCalColLabel, 2*(Ceil(NoOfRows()/2)-RowNo()))

Peter_Cammaert
Partner - Champion III
Partner - Champion III

This also works:

=RangeSum(Below(Sum(BRUTO), 0, NoOfRows()+1-RowNo()))

Note that the names of Above and Below point to the visual orientation, not the effective RowNo-related order in your "table" object.

Not applicable
Author

Hii Andreas,

Use the following expression:-

if(isnull(above(Total Number)),sum(total Number),above(total )-above(total Number))

Find the attached QVW for solution.

mr_novice
Creator II
Creator II

Table

A,B,C

52,y,x

51,y,x

In script:

Sort the table on Week desc. Then use numsum(B*-1,peek(C)) to create a new field with desired calculation.

Br

Cris