Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Ran
Contributor III
Contributor III

Others with 0 values

Hi,

i have table with

dim -countries

and

measure - amout of flights

now i need to present everyday only top 36 countries and the rest on "Others" of that day(send nprinting)

now if i have day with 36+ countries its works fine 

but if i have day with less for exmaple 33 coutries i get table with all those 33 countries and others with 0 value

i tired to turn off "include null values" on the dim and on add-ons turn off "include zero values" and didnt worked

i also tried to go to the measure and to do  if measure=0 , null, else that measure.. and didnt worked

now i saw in this forum  that someone wrote need to do aggr(if(sum(measure)=0,null(),dim),dim)

that worked.. but  now if i do top 34 and not 36  its put me the last 2 coutries in the others even if i have  today 35 coutries(should put only 1 country in others)

 

hope someone can help me with that 🙂

Thanks!

 

 

 

 

 

1 Solution

Accepted Solutions
pravinboniface
Creator II
Creator II

@Ran I think it's working correctly from how you describe the issue.  Note that when you ask for "top N", there can only be N dimension values which also includes the dimension "Others"

that worked.. but  now if i do top 34 and not 36  its put me the last 2 coutries in the others even if i have  today 35 coutries(should put only 1 country in others)

When you ask for "top 34", there can be only 34 dimension values (including others).  So when you have 35 countries, because you asked for "top 34", 33 dimension values will be countries.  The remaining 2 will go to "Others"

View solution in original post

2 Replies
pravinboniface
Creator II
Creator II

@Ran I think it's working correctly from how you describe the issue.  Note that when you ask for "top N", there can only be N dimension values which also includes the dimension "Others"

that worked.. but  now if i do top 34 and not 36  its put me the last 2 coutries in the others even if i have  today 35 coutries(should put only 1 country in others)

When you ask for "top 34", there can be only 34 dimension values (including others).  So when you have 35 countries, because you asked for "top 34", 33 dimension values will be countries.  The remaining 2 will go to "Others"

Ran
Contributor III
Contributor III
Author

@pravinboniface 

ok i thought when i ask for 34 it will give me 34 and the rest on others and not 33 +others

 

Thanks