Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
laura_1
Partner - Contributor III
Partner - Contributor III

Limiting dimension values in charts

Hi all, 

I would like to limit dimension values on a chart so that it's part based on a measure value and part of it is fixed. Let's suppose we have the following  table:

Field 1Value
A10
B40
C5
80
140
220
360
4100

 

I'd like values A, B, C and D to be always displayed in a dimension plus the top 2 from the remaining values, so in this case it would be 3 and 4 (so my dimension should display A, B, C, D, 3, 4). How could this be achieved? 

Thanks,

Laura 

3 Replies
sunny_talwar

May be this

RangeSum(
Sum({<Field1 = {'A', 'B', 'C', 'D'}>} Value),
Sum({<Field1 = {"=Rank(Sum({<Field1 -= {'A', 'B', 'C', 'D'}>}Value)) < 3"}>} Value)
)
sunny_talwar

Or even this

Sum({<Field1 = {"=Rank(Sum({<Field1 -= {'A', 'B', 'C', 'D'}>}Value)) < 3"}+{'A', 'B', 'C', 'D'}>} Value)
laura_1
Partner - Contributor III
Partner - Contributor III
Author

Thank you Sunny that works great!

Just wondering if I want the calculation in my measure to be a share calculation, so e.g. the share of each value in the Field1 column out of the total, is there a way for that calculation to ignore the limitation in that dimension? 

Given that the dimension has been limited to A, B, C, D, 3 and 4, Qlik calculates the total based on these values, rather than A, B, C, D, 1, 2, 3, & 4.