Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
benhumphrey
Contributor
Contributor

Rank Top 15 and Bottom 15, total of everything

Hi,

I have a straight table which has the dimension of Category, Part and a expression of Sum of Amount.

I am using the following as a calculated dimension =aggr(if(rank(sum(gltr_amt))<=15 or rank(-sum(gltr_amt))<=15,Part),Part)

This works but gives me some nulls which are the remainder of Items, I use suppress null values to show just the Top 15 and Bottom 15 Parts. However by doing this the expression total only calculates on the Top 15 and Bottom 15.

What i want to do is show the Top 15 and Bottom 15 like i have at the moment, but have the total amount as the whole total not just the sum of the Top 15 and bottom 15.

Is there a way to do this?

Thanks in advance

3 Replies
rubenmarin

Maybe using dimensionality() to use another expression for totals:

If(Dimensionality()>0, aggr(if(rank(sum(gltr_amt))<=15 or rank(-sum(gltr_amt))<=15,Part),Part),

sum(gltr_amt)

)

ashfaq_haseeb
Champion III
Champion III

Hi,

Check if this helps.

Regards

ASHFAQ

benhumphrey
Contributor
Contributor
Author

Thanks both of you, your answers were helpful but didn't quite provide what i needed. It has been approached in a different way now to resolve this.