dbaspot
Tags Register FAQ Calendar Search Today's Posts Mark Forums Read

add an measure to distinct count employee_id instead of employee_k - sqlserver-datawarehouse

This is a discussion on add an measure to distinct count employee_id instead of employee_k - sqlserver-datawarehouse ; Hi, I would like to add another measure into cube which is counting distinct employee_id instead of employee_key (surrogate key) This is the relationship I have in cube Fact_employee_time: Fact_time_key, Employee_key, Date_Key, .... hours, cost,.. Fact_employee_travel: Fact_travel_key, Employee_key, Date_Key, airfare, ...


Home > Database Forum > Data Warehousing > sqlserver-datawarehouse > add an measure to distinct count employee_id instead of employee_k

Reply

 

LinkBack Thread Tools Display Modes
  #1  
Old 10-24-2008, 06:48 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default add an measure to distinct count employee_id instead of employee_k

Hi,

I would like to add another measure into cube which is counting distinct
employee_id instead of employee_key (surrogate key)

This is the relationship I have in cube

Fact_employee_time: Fact_time_key, Employee_key, Date_Key, .... hours, cost,..
Fact_employee_travel: Fact_travel_key, Employee_key, Date_Key, airfare, ...
dim_employee: Employee_key, Employee_id, ... (same employee_Id has many
employee_key)

Is there any MDX to pull distinct employee count (distinct employee_ID
count) as a measure. FACT and DIM table only use Key to join. Couldn't get
the right MDX to work to get distinct employee_id count at this moment.

Thank you in advance.
--
Best Regards,

Lynn
Reply With Quote
  #2  
Old 10-26-2008, 09:27 PM
Database Bot
 
Join Date: Sep 2009
Posts: 1,236,254
Database Administrator is on a distinguished road
Default Re: add an measure to distinct count employee_id instead of employee_k

Add column for Employee_Id to Fact tables and define new measure based on it
with the option of Distinct Count.

Ohjoo.


"Lynn" wrote in message
news:2D661EDF-F3CA-4868-802A-C8C367F37F07@microsoft.com...
> Hi,
>
> I would like to add another measure into cube which is counting distinct
> employee_id instead of employee_key (surrogate key)
>
> This is the relationship I have in cube
>
> Fact_employee_time: Fact_time_key, Employee_key, Date_Key, .... hours,
> cost,..
> Fact_employee_travel: Fact_travel_key, Employee_key, Date_Key, airfare,
> ...
> dim_employee: Employee_key, Employee_id, ... (same employee_Id has many
> employee_key)
>
> Is there any MDX to pull distinct employee count (distinct employee_ID
> count) as a measure. FACT and DIM table only use Key to join. Couldn't
> get
> the right MDX to work to get distinct employee_id count at this moment.
>
> Thank you in advance.
> --
> Best Regards,
>
> Lynn



Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 11:48 AM.