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: 
sonikajain
Partner - Contributor
Partner - Contributor

total of top 5 rows--pls help

Dear all,

Please help me on calculation of sumof top 5 rows from a set of records.Ex:I have Division and Balance.

I need to display the sum of top five balance, and the balance for rest of the divisions, something like .

Sum of   top 5 divisionsValue(sum (BALANCE))
OthersValue(sum(BALANCE))

I am writing expressions (for sum top 5)  as - if(Division = 'Sum of top 5 divisions', sum(if( rank(aggr( sum(BALANCE),DIVISION),4)<6,)...but this is not working..Please help me with the expressions

Thanks,

Sonika

3 Replies
phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Hi,

See if attached helps.

=IF (aggr(rank( sum(BALANCE) ,0) , DIVISION )<= 5 , 'Sum of Top 5 Divisions' ,'Others')

Regards

Phani

sonikajain
Partner - Contributor
Partner - Contributor
Author

The dimensions - Sun of top 5 and Others, am  creating using inline table. Please help me on writing expressions for the values.

phaneendra_kunc
Partner - Specialist III
Partner - Specialist III

Can you throw a sample what you are trying to acheive..