3 Replies Latest reply: Jun 29, 2010 9:39 PM by John Witherspoon RSS

    Group 'age' dimension

    TjeerdPolstra

      Hi all,

      I am creating a vertical bar chart where the age of a sample is the dimension. The expression is irrelevant for the question.

      Taking age as a dimension, all ages are displayed seperately. Which is less informational for my situation than grouping them into age groups (eg. 10-20; 20-30; 30-40... etcetera)

      I suppose I could achieve this by pre editing my load data, or by working with the load data during load..? But rather; I would like to do this when creating the chart, anyone know of a way? Maybe there is an option where I can manually group dimension values and rename them?

      Curious of any thoughts on this or on best practices on my situation! Thx in advance (this is my first forum post)

      Cheers

        • Group 'age' dimension
          Ashish Kumar

          age is there in side the qlikview with the help of age() you find out the age and then you make

          age bucket with the help of class function

           

          Regards

          Ashish Srivastava

           

            • Group 'age' dimension
              TjeerdPolstra

              Thx for quick respons! Got both age and class functions to work.

              Though, I need to class non continously (forgot to mention that in my earlier post). Like this:

              0-20

              24-29

              30-34

              35-39

              40-44

              44-49

              50-54

              55-59

              60-64

              65-69

              70+

              This is now my class code:

               


              =class(Leeftijd,10,Leeftijd,15)


              Regards

                • Group 'age' dimension
                  John Witherspoon

                  I'd do it during the load. But if you want to do it in a chart, I'd just use nested if() statements:

                  if(Age<=20,dual( '0-20',20)
                  ,if(Age<=23,dual('21-23',23)
                  ,if(Age<=29,dual('24-29',29)
                  ...)))

                  The dual() function is there to make sure the data gets sorted properly, though in this case you should be fine without it. But it's often required, so I'll leave it in the example.