Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
fgiorgio
Contributor

Subtotal Field A at change of Field B

Hi all,

In a straight table chart, I have one column displaying Sales Order No (s_order) and another column displaying the Sales order Total Inc (order_total).

I need to display a subtotal for "order_total" at every change of "s_order".

can anyone direct me on how to achieve this?

Thanks in Advance!!

F.Giorgio

1 Solution

Accepted Solutions
rahulpawarb
Valued Contributor III

Re: Subtotal Field A at change of Field B

Hello Fabrizio,

Thank you for sharing the required files.

To fix this issue I have shifted the BOrders Total inc & InPicking Total inc from dimensions tab to Expression tab.

Please refer attached modified application file.

Regards!

Rahul

24 Replies

Re: Subtotal Field A at change of Field B

Look at partial sum from presentation tab?

Life is so rich, and we need to respect to the life !!!
vinieme12
Esteemed Contributor II

Re: Subtotal Field A at change of Field B

Change your table to a pivot table and use Partial Sum option in the presentation tab for your field which you want see subtotals for

Re: Subtotal Field A at change of Field B

Above two suggestions are guiding you in the right direction, but for more help on this topic, share a small sample with the expected output.

fgiorgio
Contributor

Re: Subtotal Field A at change of Field B

Hi Sunny,

Thanks for your input...

here's a simplified representation of what the output should look like...

Price subtotal at change in Sales Order No...

   

Customer AccSales Order NoProductPrice
Mr X123456Product A10
Mr X123456Product B20
Mr X123456Product C30
Price Subtotal60
Mr Y123457Product X5
Mr Y123457Product Y10
Mr Y123457Product Z15
Price Subtotal30

Is there a way this could be done in a straight table?


if not can a pivot table always display all fields as expanded?


thanks again for your assistance...


F.Giorgio

Re: Subtotal Field A at change of Field B

Is there a way this could be done in a straight table?

Simply answer is No

if not can a pivot table always display all fields as expanded?

Yes, It would. Is that is okay for you. Same Thing straight table here you need to enable option from presentation tab called "Always Fully Expanded"

Capture.PNG

Life is so rich, and we need to respect to the life !!!
vinieme12
Esteemed Contributor II

Re: Subtotal Field A at change of Field B

fgiorgio
Contributor

Re: Subtotal Field A at change of Field B

Hi Anil,

Sorry for the delayed reply, I only have time to work on this here and there...

I have now setup the report as a Pivot table and it looks great...

I have tried using the "Show Partial Sums" and I can roughly understand how this works however I can't get a subtotal of my Price at each change of SOrder...

Do I need to use the Sum(Price) expression and where do I put this in order for this to display under the price column?

If someone could let me know when you have a chance that would be appreciated...

Thanks.

F.Giorgio

Re: Subtotal Field A at change of Field B

Good, Here you need to understand is how Partial Sum works

This is basic example to understand Partial Sums

For Editing the name, You could go like image, For your way this should run for "Sales Order"

Capture.PNG

Life is so rich, and we need to respect to the life !!!
fgiorgio
Contributor

Re: Subtotal Field A at change of Field B

Hi Anil and all,

I appreciate everyone's help and I did look at all the advise and links provided, however I still cannot understand how to achive this.

Here's an exerpt from my actual report below.

What I am trying to achieve is a subtotal sum of BOrders Total Inc and In Picking Total Inc at the change of every S/Order.

The subtotal row is in the correct place, but I cannot understand how to display the subtotals in that row.

I am not sure if there are expressions involved to achieve this and where these expressions need to be applied.

Any help would be appreciated...

Thanks

Qlikview Subtotals.JPG

Community Browser