Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
villegasi03
Creator
Creator

Grouping Based on Value within Range

I am trying to find the easiest way to group employees based on tenure. I have everyones start date and I was going to get the number of days that they have been employed by taking the current day minus the start date. I then want to join my list to the table below which would give me their tenure group.

Any assistance would be great. Thank you.

.

TenureGrpMinDaysMaxDays
0 to 2 Months059
2 to 4 Months60119
4 to 6 Months120179
6 to 8 Months180239
8 to 10 Months240299
10 to 12 Months300360
Over 12 Months3611000000
1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

you can use the class function ,

attach is an example

View solution in original post

5 Replies
Gysbert_Wassenaar

You can use the intervalmatch function. See the attached example for a demonstration of this function.


talk is cheap, supply exceeds demand
lironbaram
Partner - Master III
Partner - Master III

you can use the class function ,

attach is an example

villegasi03
Creator
Creator
Author

Gysbert - thank you for the usefule info.

Liron - Thank you for the example as well. I have never used the class function before. This actually worked out perfect. It also gave me a million ideas on how to use it on other projects.

thanks to all for you assistance.

Gysbert_Wassenaar

Personally, I prefer the intervalmatch in cases as these. You have more flexibility with the names of the ranges and you aren't limited to the fixed interval width of the class function. For months >12 you need an extra if statement to group all classes over 12 months together.


talk is cheap, supply exceeds demand
villegasi03
Creator
Creator
Author

Gysbert - Crazy that you just replied. I just tried to integrate the class method and I ran into just that issue. Thank you for pointing that out.