dbTalk Databases Forums  

Advice on creating an element in a cube

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


Discuss Advice on creating an element in a cube in the microsoft.public.sqlserver.olap forum.



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

Default Advice on creating an element in a cube - 07-07-2004 , 02:11 PM






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

Reply With Quote
  #2  
Old   
Bill Cheng
 
Posts: n/a

Default RE: Advice on creating an element in a cube - 07-07-2004 , 09:22 PM






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.
--------------------
Quote:
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



Reply With Quote
  #3  
Old   
IUnknown
 
Posts: n/a

Default RE: Advice on creating an element in a cube - 07-08-2004 , 09:45 AM



billchng (AT) online (DOT) microsoft.com ("Bill Cheng") wrote in
newsr6aTJJZEHA.228 (AT) cpmsftngxa06 (DOT) phx.gbl:

Quote:
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
|


Thank you.. that does indeed answer my question. That ends up being
what I thought the answer was and we proceeded down that path. I
appreciate the help!

Jarrod


Reply With Quote
  #4  
Old   
IUnknown
 
Posts: n/a

Default RE: Advice on creating an element in a cube - 07-08-2004 , 09:46 AM



billchng (AT) online (DOT) microsoft.com ("Bill Cheng") wrote in
newsr6aTJJZEHA.228 (AT) cpmsftngxa06 (DOT) phx.gbl:

<cut>

That does indeed sound like the problem and the solution we looked at and
ended up implementing. Thank you very much for the help!

Jarrod


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.