Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Chart with employee ranges?

Hi everyone,

I'm in the process of building my first QlikView App, and need some help figuring out how to create ranges as dimensions on a bar chart.  I've tried a few different functions, but none of them seem to do what I need..

I am trying to create the following ranges for "number of employees" field.  So, for 1-500, 501-1000, 1001-5000, 5001-10000, etc.  I want to count the number of distinct IDs that fall within each range.  Any help will be appreciated.

Thanks,

Meghan

1 Solution

Accepted Solutions
john_duffy
Partner - Creator III
Partner - Creator III

Hi Meghan.

One method would be to create a range field in your load scripts to use as the dimension in your bar chart.

See the attached example.

John.

View solution in original post

3 Replies
mphekin12
Specialist
Specialist

Meghan,

Can you post a sample of your application?

john_duffy
Partner - Creator III
Partner - Creator III

Hi Meghan.

One method would be to create a range field in your load scripts to use as the dimension in your bar chart.

See the attached example.

John.

sudeep_d
Partner - Creator
Partner - Creator

Hi meghan,

if for eg u want to make range for salary amount for distinct employee id's ,there are two way of doin it

method 1: Create a bucket of range of salaries in the script

   eg: if(salary>0 and salary<1000,'0-999',

           if(salary>=1000 and salary<2000,'1000-1999',

              if(salary>=2000,'>2000'))) as salrange

  and once u reload the app,field salrange will have that bucket which u can add in the dimension and in the expression u can use count(distinct employee_id)

method 2:  use class function

   eg: select chart and in the dimension tab click on add calculated dimension where u can use the below expression

        =class(salary,1000,'range')

    where 1000 is the length of range

and  range is the string that pops up in the dimension

thereafter in the expression tab u can use the below expression

     count(distinct employee_id)

hope this helps

Sudeep