Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

different size class in bar chart

Dear all,

I am looking for a way that I can create classes with different sizes to create buckets with. In this case it is to create buckets of companies depending on the amount of employees they have.

In sql this statement is as follow:

case when count (distinct 'Employee') = 1 then '1 person'          

when count (distinct Employee) = 2 then '2 persons'         

when count (distinct Employee) >= 3 and count (distinct Employee) < 5 then '3 to 5'          

when count (distinct Employee) >= 5 and count (distinct Employee) < 10 then '5 to 10'         

when count (distinct Employee) >= 10 and count (distinct Employee) < 20 then '10 to 20'         

when count (distinct Employee) >= 20 and count (distinct Employee) < 50 then '20 to 50'         

when count (distinct Employee) >= 50 and count (distinct Employee) < 100 then '50 to 100'         

when count (distinct Employee) >= 100 and count (distinct Employee) < 150 then '100 to 150'         

when count (distinct Employee) >= 150 and count (distinct Employee) < 200 then '150 to 200'         

when count (distinct Employee) >= 200 and count (distinct Employee) < 250 then '200 to 250'         

when count (distinct Employee) >= 250 and count (distinct Employee) < 500 then '250 tot 500'         

when count (distinct Employee) >= 500 and count (distinct Employee) < 1000 then '500 tot 1000'         

when count (distinct Employee) >= 1000 and count (distinct Employee) < 2000 then '1000 tot 2000'         

when count (distinct Employee) >= 2000  then 'more than 2000'          

end as 'Company size'

Thanks in advance for all help!

1 Reply
sunny_talwar

May be like this

If(count (distinct 'Employee') = 1, Dual('1 person', 1),

If(count (distinct Employee) = 2, Dual('2 persons', 2),

If(count (distinct Employee) < 5, Dual('3 to 5', 3),

If(count (distinct Employee) < 10, Dual('5 to 10', 4),

If(count (distinct Employee) < 20, Dual('10 to 20', 5),

If(count (distinct Employee) < 50, Dual('20 to 50', 6),

If(count (distinct Employee) < 100, Dual('50 to 100', 7),

If(count (distinct Employee) < 150, Dual('100 to 150', 8),

If(count (distinct Employee) < 200, Dual('150 to 200', 9),

If(count (distinct Employee) < 250, Dual('200 to 250', 10),

If(count (distinct Employee) < 500, Dual('250 tot 500', 11),

If(count (distinct Employee) < 1000, Dual('500 tot 1000', 12),

If(count (distinct Employee) < 2000, Dual('1000 tot 2000', 13),

If(count (distinct Employee) >= 2000 , Dual('more than 2000', 14)))))))))))))))