![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Subject: Advice on creating an element in a cube From: IUnknown <swradio (AT) hotmail (DOT) com Message-ID: <Xns951F9050AD5DCswradiohotmailcom (AT) 207 (DOT) 46.248.16 User-Agent: Xnews/5.04.25 Newsgroups: microsoft.public.sqlserver.olap Date: Wed, 07 Jul 2004 12:11:18 -0700 NNTP-Posting-Host: adsl-068-157-208-248.sip.bna.bellsouth.net 68.157.208.248 Lines: 1 Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.olap:51386 X-Tomcat-NG: microsoft.public.sqlserver.olap I have the following problem presented to me here at work: I have a column of type date, and I am wanting to count the number of unique and individual dates in a month that a given primary key has in the database. For example: provider key , date. My goal is to count for each month the number of days (unique days) a specific provider key has a record. The end result is going into crystal analysis where the user can drill-through and produce month by month reports. So.. is it possible to take a date field and count the number of unique total dates in it per month as a reference to a given primary key? Jarrod |
#3
| |||
| |||
|
|
Hi Jarrod, I would like to confirm with your question. For example, we have the following data providerkey date 1 2004/7/7 1 2004/7/6 1 2004/7/6 1 2004/6/13 2 2003/7/8 3 2003/12/1 so for providerkey 1, for 2004/7, the number of unique dates is 3. If I misunderstood you, please describe the problem in details. If so, I think you can create another column in fact table to indicate month dimension. We can create providerkey dimension, month dimension, and a measure DISTINCT COUNT (date). Then we can group by providerkey and month, and retrieve distinct date number. If let me know if that answers you questions. Thanks. Bill Cheng Microsoft Online Partner Support Get Secure! – www.microsoft.com/security This posting is provided “as is” with no warranties and confers no rights. -------------------- | Subject: Advice on creating an element in a cube | From: IUnknown <swradio (AT) hotmail (DOT) com | Message-ID: <Xns951F9050AD5DCswradiohotmailcom (AT) 207 (DOT) 46.248.16 | User-Agent: Xnews/5.04.25 | Newsgroups: microsoft.public.sqlserver.olap | Date: Wed, 07 Jul 2004 12:11:18 -0700 | NNTP-Posting-Host: adsl-068-157-208-248.sip.bna.bellsouth.net 68.157.208.248 | Lines: 1 | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl | Xref: cpmsftngxa06.phx.gbl microsoft.public.sqlserver.olap:51386 | X-Tomcat-NG: microsoft.public.sqlserver.olap | | I have the following problem presented to me here at work: | | I have a column of type date, and I am wanting to count the number of | unique and individual dates in a month that a given primary key has | in the | database. | | For example: provider key , date. | | My goal is to count for each month the number of days (unique days) a | specific provider key has a record. The end result is going into | crystal analysis where the user can drill-through and produce month | by month reports. | | So.. is it possible to take a date field and count the number of | unique total dates in it per month as a reference to a given primary | key? | | Jarrod | |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |