8 Replies Latest reply: Jul 21, 2017 3:02 PM by Jose Miguel Vilaplana

# Survey Data Analysis-Gouping Age

Hi All,

I have data with a column of age with different ages. I want to convert them in age groups. and want to show these groups as dimension and there % as measure. E.g

Dimension:   Age(5-15), Ag(16-30), Age(30+)

Measure:      20%, 30%, 50%

Any solution?

Thanks

• ###### Re: Survey Data Analysis-Gouping Age

Hi,

You can use the Class function, making groups

class ‒ QlikView

Regards

• ###### Re: Survey Data Analysis-Gouping Age

Thanks. How can I use this in formula? . I do not want to do anything in load script and to change my table definition. if I could do any thing on the fly in formula expression in dimension/measure?

• ###### Re: Survey Data Analysis-Gouping Age

Yes, you can do it in the object

Write in the dimension:

Class(Age, 15)

It makes groups of 15

• ###### Re: Survey Data Analysis-Gouping Age

Thanks. it worked. Can I use range in match function like 2-10, or 20 - 25 , rather than using hard coding each value? thanks

• ###### Re: Survey Data Analysis-Gouping Age

You can use If statement

If(Age >= 2 and Age <= 10, Dual('2-10', 1),

If(Age >= 20 and Age <= 25, Dual('20-25', 2)))

• ###### Re: Survey Data Analysis-Gouping Age

Hi, I think is not possible, the ranges are always equal.

• ###### Re: Survey Data Analysis-Gouping Age

Using if Jose

• ###### Re: Survey Data Analysis-Gouping Age

Hi stalwar1

Of course you can do it with "if" but is necesary to define the groups before. With "Class" you can have all the groups you need.

Regards