Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
prma7799
Master III
Master III

Total ... Above

Hi,

It is very small question to all of you but I want to know what is Total and Above function and how it works with example ?

Thanks

PM

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

Consider below small Inline Table... Load it in your QVW script...

Load * Inline

[

  ID, Month, Sales

  A, Jan, 100

  A, Feb, 150

  A, Mar, 250

  C, Jan, 50

  C, Feb, 100

  C, Mar, 150

  D, Jan, 25

  D, Feb, 50

  D, Mar, 125

];

Now create a Straight Table

Dimension

ID

Month

Expression

1) SUM(Sales)

This will give you Total Sales per ID per Month

2) SUM(TOTAL Sales)

This will give you Total Sales for all ID and Month (this will be changed based on selection)

Create a List Box for Month and ID and try to select any value from them... This will give you changed result..

3) SUM(ALL Sales)

Same result as above while not selected anything.. But even though if you select any value from ID or Month, the result will be the same.

4) SUM(TOTAL <Month> Sales)

Total Sales by Month

5) SUM(TOTAL <ID> Sales)

Total Sales by ID

6) RangeSum(Above(TOTAL SUM(Sales),0,RowNo()))

This will add the TOTAL Sales for each ID from 1st to last row

Hope this will help...

View solution in original post

2 Replies
MK_QSL
MVP
MVP

Consider below small Inline Table... Load it in your QVW script...

Load * Inline

[

  ID, Month, Sales

  A, Jan, 100

  A, Feb, 150

  A, Mar, 250

  C, Jan, 50

  C, Feb, 100

  C, Mar, 150

  D, Jan, 25

  D, Feb, 50

  D, Mar, 125

];

Now create a Straight Table

Dimension

ID

Month

Expression

1) SUM(Sales)

This will give you Total Sales per ID per Month

2) SUM(TOTAL Sales)

This will give you Total Sales for all ID and Month (this will be changed based on selection)

Create a List Box for Month and ID and try to select any value from them... This will give you changed result..

3) SUM(ALL Sales)

Same result as above while not selected anything.. But even though if you select any value from ID or Month, the result will be the same.

4) SUM(TOTAL <Month> Sales)

Total Sales by Month

5) SUM(TOTAL <ID> Sales)

Total Sales by ID

6) RangeSum(Above(TOTAL SUM(Sales),0,RowNo()))

This will add the TOTAL Sales for each ID from 1st to last row

Hope this will help...

prma7799
Master III
Master III
Author

Thanks Manish..

Such a nice explanation it is very helpful for me

Thanks

PM