# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

New Contributor II

## Calculate Total on Table

Hi All,

I wish to calculate the Total by Part as below by using below expression, but it not allow to me filter any dimension.

 Company Name Part No Qty Total By Part A 1 100 100 B 2 20 30 C 3 30 70 A 2 10 30 C 3 40 70

SUM({1}TOTAL <Part No>Qty)

Steve

1 Solution

Accepted Solutions
Partner

## Re: Calculate Total on Table

maybe this:

rangesum( aggr( NODISTINCT sum( {< [Company Name] >} Qty ), [Part No] ) )

7 Replies
Partner

## Re: Calculate Total on Table

what about SUM(TOTAL <Part No> Qty) ?

New Contributor II

## Re: Calculate Total on Table

When I filter Company A, the part 2 show 10, instead of 30.

I need it show the grand total of each part, even filter by company or other dimension.

Thanks

Steve

Partner

## Re: Calculate Total on Table

You could do it inside the script:

TABLE:
LOAD * INLINE [
Company Name, Part No, Qty, Total By Part
A, 1, 100, 100
B, 2, 20, 30
C, 3, 30, 70
A, 2, 10, 30
C, 3, 40, 70
];

Left Join (TABLE)
[Part No],
Sum(Qty) AS TOTAL
Resident TABLE
Group By
[Part No]
;

Partner

## Re: Calculate Total on Table

maybe this:

rangesum( aggr( NODISTINCT sum( {< [Company Name] >} Qty ), [Part No] ) )

MVP

## Re: Calculate Total on Table

You can override the company selection in the expression:

SUM({<[Company Name]>} TOTAL <Part No> Qty)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP

## Re: Calculate Total on Table

You can try this

``Sum({<[Company Name]>} TOTAL <Part No> Qty) * Avg(1)``
Highlighted
New Contributor II

## Re: Calculate Total on Table

Thanks all, manage to find a solution 😀

Thanks

Steve