# Qlik Sense App Development

Contributor II

## Sum in Qlik Sense pivot table

Hi,

I need your help regarding below functionality. I have data in pivot table as below-

What i want is Begining of next month should be ending of previous month as below-

How can i do this, i have attached QVF file.

1 Solution

Accepted Solutions
MVP

## Re: Sum in Qlik Sense pivot table

I think you don't want to use Sum(A) in the before function

RangeSum(RangeSum(Before(Sum(A)-Sum(B)-Sum(C)+Sum(D)+Sum(E)+Sum(F)-Sum(G)+Sum(H), 1,

ColumnNo())), First(Sum(A)))

Try this:

RangeSum(RangeSum(Before(-Sum(B)-Sum(C)+Sum(D)+Sum(E)+Sum(F)-Sum(G)+Sum(H), 1,

ColumnNo())), First(Sum(A)))

6 Replies
MVP

## Re: Sum in Qlik Sense pivot table

May be try this

Beginning

RangeSum(RangeSum(Before(Sum(B)+Sum(C)-Sum(D), 1, ColumnNo())), First(Sum(A)))

Ending

Column(1) + Column(2) + Column(3) - Column(4)

Contributor II

## Re: Sum in Qlik Sense pivot table

Hi Sunny,

This only works for first two date in pivot table, I want this functionality for complete pivot table.

Note: Range Sum function not works in pivot table as works in other chart.

Thanks!

MVP

## Re: Sum in Qlik Sense pivot table

Really? Looks like the numbers are matching for me

App Screenshot

Where is the difference?

Contributor II

## Re: Sum in Qlik Sense pivot table

Hi Sunny,

I tried the same but can't get result, could you please suggest where i am making mistake.

I have attached QVF file.

Thanks!

MVP

## Re: Sum in Qlik Sense pivot table

I think you don't want to use Sum(A) in the before function

RangeSum(RangeSum(Before(Sum(A)-Sum(B)-Sum(C)+Sum(D)+Sum(E)+Sum(F)-Sum(G)+Sum(H), 1,

ColumnNo())), First(Sum(A)))

Try this:

RangeSum(RangeSum(Before(-Sum(B)-Sum(C)+Sum(D)+Sum(E)+Sum(F)-Sum(G)+Sum(H), 1,

ColumnNo())), First(Sum(A)))

Contributor II

## Re: Sum in Qlik Sense pivot table

Thank you So much Sunny