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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
steve1982
Contributor II
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 NamePart NoQtyTotal By Part
A1100100
B22030
C33070
A21030
C34070

 

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

Thanks for advice.

Steve

1 Solution

Accepted Solutions
agigliotti
MVP
MVP

maybe this:

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it

View solution in original post

7 Replies
agigliotti
MVP
MVP

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
steve1982
Contributor II
Contributor II
Author

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.

clipboard_image_1.png

 

Thanks

Steve

StarinieriG
Partner - Specialist
Partner - Specialist

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)
LOAD
[Part No],
Sum(Qty) AS TOTAL
Resident TABLE
Group By
[Part No]
;

agigliotti
MVP
MVP

maybe this:

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

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it
jonathandienst
Partner - Champion III
Partner - Champion III

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
sunny_talwar
MVP
MVP

You can try this

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

Thanks all, manage to find a solution 😀

Thanks

Steve