3 Replies Latest reply: May 26, 2012 4:51 AM by Sudeep Dhoju RSS

    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

        • Chart with employee ranges?
          Mike Hennigan

          Meghan,

           

          Can you post a sample of your application?

          • Re: Chart with employee ranges?
            John Duffy

            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.

            • Chart with employee ranges?
              Sudeep Dhoju

              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