Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
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
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Modify your expression to like:
=sum({<Id={"=Rank(Sum(Sal))<=$(vTopBooking)"}>}Sal)
And remove the limit max number from presentation tab.
 
					
				
		
 sasiparupudi1
		
			sasiparupudi1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Undert total mode,choose sum of rows option in the expression tab for your expression.
hth
Sasi
 qlikviewwizard
		
			qlikviewwizard
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Can you attach the sample data?
 
					
				
		
please post the expression you are using,so can help
 
					
				
		
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
 
					
				
		
i think AGGR function will help you
 tresesco
		
			tresesco
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Modify your expression to like:
=sum({<Id={"=Rank(Sum(Sal))<=$(vTopBooking)"}>}Sal)
And remove the limit max number from presentation tab.
 
					
				
		
Thanks a lot tresesco, It's working 
 
					
				
		
Thank you so much everyone for helping me 
 
					
				
		
 avinashelite
		
			avinashelite
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		if you have got the answer mark the correct answer and close this thread
