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: 
pgloc2020
Creator
Creator

Display selected values in dimension and display rest values as "Others"

Hello,

I have a requirement to display only specific values in bar chart dimension and calculate rest of the values as "Others".

I used the following expression in the Dimension but it is giving me other Cities too including the ones I want -

=If( Match(TOTAL, 'NY, 'DC','CA', TOTAL,'Others'), TOTAL)

I also used =Aggr(ONLY({<TOTAL={"NY", "DC", "CA",}>} TOTAL),TOTAL)

But this gives my only 3 cities the ones I specified. 

In the Sorting, I have used following expression Match([TOTAL], "NY", "DC", "CA") with no successes of displaying OTHERS category. 

In my Data I have several cities as Dimension and as a measure I have a total order as "TOTAL".

My requirement is to display only 3 cities total and display other cities as "OTHER" and their total. 

Please let me know what expressions should I use. 

Labels (5)
1 Solution

Accepted Solutions
Aasir
Creator III
Creator III

=Aggr(
If(Match(TOTAL, 'NY', 'DC', 'CA'), TOTAL, 'Others'),
TOTAL
)

In the sorting

=If(Match([TOTAL], 'NY', 'DC', 'CA'), 0, 1)

View solution in original post

2 Replies
Aasir
Creator III
Creator III

=Aggr(
If(Match(TOTAL, 'NY', 'DC', 'CA'), TOTAL, 'Others'),
TOTAL
)

In the sorting

=If(Match([TOTAL], 'NY', 'DC', 'CA'), 0, 1)

pgloc2020
Creator
Creator
Author

Thank you, it works as I needed.