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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Partial Sum in Straight Table

Hi,

I am using a straight table. I want the Total Sum of field should be based on the rows which are getting display after selection.

The total should be vary based on 'Top N' values.

Could you please help me on this? Do I need to use Aggr function for that?

How to display total in Straight Table based on the 'Top N' Selection?

Please see the attached screen shot. I am selecting Top 5 records but still it is showing the whole Total.

Thank you.

Regards,

Poonam Patil

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Modify your expression to like:

=sum({<Id={"=Rank(Sum(Sal))<=$(vTopBooking)"}>}Sal)

And remove the limit max number from presentation tab.

View solution in original post

9 Replies
sasiparupudi1
Master III
Master III

Undert total mode,choose sum of rows option in the expression tab for your expression.

hth

Sasi

qlikviewwizard
Master II
Master II

Hi,

Can you attach the sample data?

Anonymous
Not applicable
Author

please post the expression you are using,so can help

Not applicable
Author

Hi,

Please see the attached example.

I have used Straight Table. and displaying Top 'N' records by setting variable in 'Max Number ' field.

if I use Pivot Table, I can get Total by marking partial Sum option but in Straight Table it is not possible.

But in Pivot Table I cannot set variable to get max record. So I need to use Straight Table.

In the attached file, I am showing Top 3 records, but it is displaying whole total. But I want to show only Top 3 records Total. (Please see attached  'Total.QVW' and 'Example.jpg')

Thanks.

- Poonam

Not applicable
Author

i think AGGR function  will help you

tresesco
MVP
MVP

Modify your expression to like:

=sum({<Id={"=Rank(Sum(Sal))<=$(vTopBooking)"}>}Sal)

And remove the limit max number from presentation tab.

Not applicable
Author

Thanks a lot tresesco, It's working

Not applicable
Author

Thank you so much everyone for helping me

avinashelite

if you have got the answer mark the correct answer and close this thread