Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

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

Re: RangeSum

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.

8 Replies
preminqlik
Valued Contributor II

Re: RangeSum

hi try below one

i think you are doing in UI,

take 3rd expression as 

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

sushil353
Honored Contributor II

Re: RangeSum

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

Re: RangeSum

Thx for helping me, but doesn't work.

Not applicable

Re: RangeSum

Thx for helping me, but doesn't work.

MVP
MVP

Re: RangeSum

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

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

Re: RangeSum

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

Re: RangeSum

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
Contributor II

Re: RangeSum

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