Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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
Contributor III

Re: Chart with employee ranges?

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.

3 Replies
mphekin12
Valued Contributor

Chart with employee ranges?

Meghan,

Can you post a sample of your application?

john_duffy
Contributor III

Re: Chart with employee ranges?

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
Contributor

Chart with employee ranges?

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