Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Grouping ages into bands

New to Qlikview

So I have a huge set of data with information on different people. Ages range from 17 to 93. Is there a way I can simply group these ages into bands of 5. So instead of having age as 17,18,19...,93 it would be 17-21, 22-26,....

(A bit of context, I want to group these ages and work out the average Insurance premium charged in each age group. So instead of having an average for each age seperately it would have an average for each age group.)

Cheers

(Sorry if posted in wrong forum)

Tags (1)
1 Solution

Accepted Solutions
marcus_malinow
Valued Contributor III

Re: Grouping ages into bands

Kristian,

a couple of ways to achieve this spring to mind.

Either, set up a table with the ranges and use an IntervalMatch in your load

Or if your groups are the same length (e.g. all are 5 years), you can use a Class in your charts.

Marcus

12 Replies
marcus_malinow
Valued Contributor III

Re: Grouping ages into bands

Kristian,

a couple of ways to achieve this spring to mind.

Either, set up a table with the ranges and use an IntervalMatch in your load

Or if your groups are the same length (e.g. all are 5 years), you can use a Class in your charts.

Marcus

deepaktibhe
Valued Contributor

Re: Grouping ages into bands

Hi,

You can use class function for this

Thanks

Re: Grouping ages into bands

HI,

Have a look at the example posted on this post.

Class function | Qlik Community

Regards,

Kaushik Solanki

yduval75
Contributor III

Re: Grouping ages into bands

Not applicable

Re: Grouping ages into bands

Cheers for the help guys. Class worked just fine.

Much appreciated.

Re: Grouping ages into bands

Custom Filter(unusual range)

Maybe also helpful if there would be unequal sized groups.

Regards

Marco

Not applicable

Re: Grouping ages into bands

Im now on something new and require grouping in different sizes. So now a list called 'Clicks' which is 0,1,2,3,4...15 I now need as 0,1,2,3-5,6-10,11+

I know you mentioned IntervalMatch but I literally have no idea how to use that.

Thanks again

marcus_malinow
Valued Contributor III

Re: Grouping ages into bands

Hi Kristian,

Marco's link above gives an example of IntervalMatch which may be useful.

Otherwise you could do something like this:

Data:

LOAD MatchedValue

etc, etc;

Intervals

LOAD * INLINE [

RangeName, RangeMin, RangeMax

0, 0, 0

1, 1, 1

2, 2, 2

3 - 5, 3, 5

etc, etc...

];

LEFT JOIN (Data)

IntervalMatch (MatchedValue)

LOAD RangeMin, RangeMax

RESIDENT Intervals;

LEFT JOIN (Data)

LOAD

RangeMin, RangeMax, RangeName

RESIDENT Intervals;

DROP TABLE Intervals;

Not applicable

Re: Grouping ages into bands

Sorry for this, like I said I'm completely new to qlikview, but what should I put in the first 'etc. etc.'?

Community Browser