Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create own sum in table

Hi!

Is it someone who has a solution to my problem?

I have an item ie. a shirt intemno 1000 with multiple colours and with multiple sizes. The items are also sold and kept in stock as a package.

S M L 15pack SKU TOTAL

Green 10 20 10 1 55

Blue 10 20 10 0 40

How can I create the sum like this?

Thanks!

1 Reply
johnw
Champion III
Champion III

I assume that "colour" and "size" are fields, and in this case, dimensions in a pivot table?

On the presentation tab, select "size", checkmark "Show Partial Sums", and enter a "Label for Totals" of SKU TOTAL.

That, of course, won't pay attention to the number that are in a 15 pack. To fix that, first you need to record how many are in each size:

Sizes:
size, number
S,1
M,1
L,1
15 pack, 15

And then use something like this as your expression instead of a simple sum(stock):

if(secondarydimensionality(),sum(stock),sum(stock*number))

Basically, it says to use a different expression for your partial sum (your total column) than you do for the rest of the chart.