dbTalk Databases Forums  

How do I do grouping for age?

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss How do I do grouping for age? in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Loon
 
Posts: n/a

Default How do I do grouping for age? - 07-04-2003 , 04:58 AM






Hi all
I have a field in fact table storing age for all people. How do i do
grouping for this people in this format 0-10 11-20 21-30 etc and when
clicking on the range will expand to the actual age and stating how
many on the actual age.
Example

0-10 5
11-20 10
21-30 6

clicking on 0-10
0 0
1 0
2 0
3 0
4 1
5 0
6 2
7 0
8 1
9 1
10 1

Thanks in advanced.

Reply With Quote
  #2  
Old   
Jono Indrawijaya
 
Posts: n/a

Default Re: How do I do grouping for age? - 07-07-2003 , 12:47 AM






Use a degenerated dimension (dimension which the data is taken from the fact
table), and then use grouping like this

Dimension Name : Age

Hierarchy :

Level Name : Age Group
Member Key Column : CONVERT(int, "FactTable"."Age" / 10)
Member Name Column : CONVERT(char, CONVERT(int, "FactTable"."Age" / 10)) + 1
+ CONVERT(char, CONVERT(int, "FactTable"."Age" / 10 + 1)) + 0

Level Name : Age
Member Key Column : "FactTable"."Age"
Member Name Column : "FactTable"."Age"

This scenario create dimension like this :
01-10
1
2

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.