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%
You can use the Class function, making groups
class ‒ QlikView
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?
Yes, you can do it in the object
Write in the dimension:
It makes groups of 15
Thanks. it worked. Can I use range in match function like 2-10, or 20 - 25 , rather than using hard coding each value? thanks
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)))
Hi, I think is not possible, the ranges are always equal.
Using if Jose
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.
Retrieving data ...