Quantcast
Channel: SQLServerCentral » Data Warehousing » Analysis Services » Latest topics
Viewing all articles
Browse latest Browse all 1341

Age groups based on difference - Date slicer

$
0
0
Hello,I have a cube I'm working with that has a dimension called Employees.In the dimension table contains a Birthdate.What I need to do in a query is count the amount of Employees However, I also have to put them into age groups using the Birthdate. Below is an example of the dimension table:[code="sql"]Employee Birthdate1 1951-04-042 1987-05-053 1986-11-044 1977-10-10[/code]So, for simplicity, lets say three age groups;Under 22;22 to 34; Over 35I have no idea how I will achieve this as I need to use a Date slicer. The way this would have to work is whatever dates in the Date slicer (MDX WHERE), would have to evaluate the date difference between the birthdate and the selected date. and then add them to the predefined groups so the example below could be shown.[code="sql"] <22 22-34 35>EmployeeCount 15 40 70[/code]Is there a way/function/MDX what I can create these groups and then group each of the employee? How would I store the birthdate for this to work; member property? attribute?Any help would go a long way.Thanks in advance

Viewing all articles
Browse latest Browse all 1341

Latest Images

Trending Articles



Latest Images