# QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

## How to made Calculation on Pivot Table?

Dear Expert,

Can I make Calculation on Pivot Table? Let me explain the process.

In this table, Firstly, I would like to get Total Buying Amount and Total Selling Amount for all date. So, I made a pivot table that have two expression is 1) sum(Buying Amount) 2) sum(Selling Amount) against ID. After that I would like to get Closing Balance for each ID. for exp, Closing balance for 111 is 900 , It can get in original table easily but I would like to know how to calculate it on Pivot table?

Best Regards,

Kyaw Myo Tun

26 Replies

## Re: How to made Calculation on Pivot Table?

Hi,

Can you give the closing balance formula? what is your dimensions?

is it possible to post the sample qvw to understand better?

Not applicable

## Re: How to made Calculation on Pivot Table?

Dear settu,

I would like to get the closing balance for each Id. The formula is so sample that ID- 111 (Opening Amount + Selling Amount - Buying Amount) for each date. The next date's Opening Amount will be previous date's Closing Amount. Please see at the above table.

Best Regards,

Kyaw Myo Tun

## Re: How to made Calculation on Pivot Table?

Hi,

Can you tell about the 5th row, how the closing balance as 900?

Not applicable

## Re: How to made Calculation on Pivot Table?

Dear settu,

That is my mistake and the closing amount will be 1500. Sorry for my mistake.

Best Regards,

Kyaw Myo Tun

## Re: How to made Calculation on Pivot Table?

is there any specific aggregation to do this, if not,

you can directly apply the below formula, right?

=(Sum(Opening Amount) + Sum(Selling Amount))-Sum(Buying Amount)

find the attached for reference

Not applicable

## Re: How to made Calculation on Pivot Table?

Dear settu,

I have some aggregations in my pivot table as I mentioned above and I also want to do calculation on that aggregated table.

Regards,

Kyaw Myo Tun

## Re: How to made Calculation on Pivot Table?

is it possible post the sample qvw and expected output?

Not applicable

## Re: How to made Calculation on Pivot Table?

Dear settu,

I am trying to upload the qvd but I can't see the attach button. Can you advice me please?

Regards,

Kyaw Myo Tun

## Re: How to made Calculation on Pivot Table?

When you are replying, top right corner in the reply window, there is option , Use Advanced editor.

click that. then, in the bottom right corner, there is attach symbol