Fact tables not loading

Hi guys,
We have installed ODI 11 with OBIA and so far the installation has been done with out any problems.But the problem here is none of the fact tables is getting loaded what would be the root cause for this.
Most of the dimension tables got loaded.By default only 1 fact table got loaded,but there are 50 fact tables in that module(HRMS & finance) but when we execute the process is running but the tables ar not loading.
Its an urgent requirement,i had no clue whats happening.Any ideas guys.
TIA,
Kranthi.
Edited by: Kranthi.K on Apr 28, 2010 3:34 AM

First of all you need to check if all the dimensions got loaded or not?
Because if a crucial dimension like customer or something else, which is being used in all fact loads is not getting loaded then obviously none of your facts will be loaded.
Hope it helps.

Similar Messages

  • Transaction data can be loaded into the Fact table without loading the

    Transaction data can be loaded into the Fact table without loading the corresponding master data (Example : Sales analysis transaction data can be loaded without populating any of its  dimension’s master data)
    a.     True
    b.     False

    Hi Kutti,
    True - You need to select the option in the infopackage - alwyas load even if no master data exists.
    Bye
    Dinesh

  • 2 fact Tables not joining to all the same dimensions

    Hi there,
    I have 2 Fact tables
    1) Errors (count)
    2) Tasks (count)
    both share the following dimension - customer
    and both have a dimension that joins only to itself
    1) Errors type (joining to errors Fact)
    2) Tasks type (joining to Tasks Fact)
    In Answers I can see customer and errors count and task count together
    When I add Errors Type, the Tasks count returns 0 (it doesn't disappear)
    When I add Tasks Type, the Errors count returns 0 (it doesn't disappears)
    customer - errors count - tasks count
    xyz 2 8
    customer - errors count - tasks count - task type
    xyz 0 8 abc
    customer - errors count - tasks count - errors type
    xyz 2 0 123
    I have seen some documentation on fact tables not joining all dimensions but any help would be appreciated
    Thanks

    The end game would be to be able to see the following:
    customer - errors type - errors count - task count - tasks type
    xyz 123 2 8 abc
    Initially I would take the either or:
    customer - errors type - errors count - task count -
    xyz 123 2 8
    customer - errors count - task count - tasks type
    xyz 2 8 abc
    I think there is something I ned to do in the Repositry?

  • Fact table mapping/loading

    I am new to OWB and trying to use OWB 9.0.4 to create a star schema on a oracle 9.2 DB. Using OWB client, I successfuly created dims and a fact table on the target DB. But I got stuck with how to use OWB to map the fact table with dims and source tables, and using OWB to generate SQL loading scripts which contains PL/SQL statement shown below:
    insert into "fact_table" ("fact_count") ( select count(*) from target_table where dim1='dime_value1' and dim2='dim2_value2');
    here dim1 and dim2 are the dims assocated with the fact table and they are also mapped to the corresponding target table columns.

    Frank,
    source table -> aggregator -> target
    As input into the aggregator, you specify dim1, dim2 and any numeric value. If you do not have one, use a numeric constant such as 1. In the aggregator, you specify dim1, dim2 as the group by clause (operator properties). You then add a numeric output attribute (edit function), and go to the attribute properties. As a function, specify count from the numeric input attribute.
    That would load your measure.
    Cube function is not currently supported in the mapping editor, but you could include that in a materialized view that is based on the table.
    Mark.

  • Fact-tables not resulting in any data

    hello experts;
    I am trying to create a mock-up report in OBI Answers and somehow Im having a problem with metric columns. When I pick any metric column then I get the: *(No Results: The specified criteria didn’t result in any data)*
    But when I pick just the fact tables, I see the results. I have doubled checked the rpd; the schemas btn the dimension and fact tables looks ok to me. I have tried union with another subject area, I get the same error. Anyone with an idea why fact tables are not collaborating with dimension tables?
    will appreciate your help

    Hi,
    Can you try to check the physical SQL generated by the reports? and see if that query is returning result in the DB or not.
    I am sure this will help you to find the root cause.
    Regards,
    Kashi

  • Fact Tables not dispalying

    Hi
    The Fact tables are not displaying on my excel sheet even though they are in the Power Pivot data.
    Thanks

    if all collumns in your fact table are of type 'number' (which is probably the case) and you did not define any measures for the fact table, then the fact table will indeed not show up in excel.
    Create a measure for the fact table (something like total amount:=calculate(sum('fact table'[amount]))) and the fact table (with the measure) will show up in excel.

  • Different granularity fact tables (NOT aggregated tables)

    Hi!
    Imagine the following Physical Layer:
    - Dimension Table "Year" (one-to-many FK relationship with "Month")
    - Dimension Table "Month" (one-to-many FK relationship with "Day" and "Sales_Month")
    - Dimension Table "Day" (one-to-many FK relationship with "PhoneCalls_Day")
    - Fact Table "Sales_Month"
    - Fact Table "PhoneCalls_Day"
    Imagine the following BMM:
    - Dimension Logical Table "Time" (which comprises the physical tables Year, Month and Day) - one-to-many relationship with the 2 Fact Logical Tables below)
    - Fact Logical Table "Sales_Month"
    - Fact Logical Table "PhoneCalls_Day"
    Both Fact Logical Tables ("Sales_Month" and "PhoneCalls_Day") are related to the Dimension Logical Table "Time". But there is no aggregation content defined in the LTS of each of those Fact Logical Tables, since they are not aggregated tables (one is for Sales per Month, and the other is for Phone Calls per Day, but Sales is not an aggregation of PhoneCalls, obviously).
    When I use answers to simply report Sales per Month (Qty_Sales, Month) the SQL generated will join "Sales_Month" physical table with "Month" physical table, but it also joins the "Month" physical table with "Day" physical table... Why?
    What should I do in order to avoid this last join?
    Thanks!!

    Thanks a lot!!
    It worked perfectly.
    Conclusion: I should create a separate LTS for each level to which a Fact Table is directly joined (not an aggregate table, because agregate tables should work fine with Agregation Content...).
    If I have a Fact Table per Year, another per Month and another per Day, then I should have 3 LTS.
    Since I only have one Fact table per Month and another per Day, I created only 2 LTS: Month (which has the join with Year) and Day.
    Thanks.

  • SSMA for Sybase - Table Not Load: Invalid Column Name fill_factor

    I am trying to convert from Sybase 11.5 to SQL 2005 and when I refresh from database I receive the following errors.  Fill_Factor is not a column in the tables in Sybase.  Any thoughts on what might be going on?
    Analyzing metadata...
    Converting procedure Mortality.dbo.proc_exposure_1 ...
    Sybase Server Object Collector error: table : company_mortality_rate_tbl
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.
    Sybase Server Object Collector error: table : study
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.
    Converting procedure Mortality.dbo.proc_mortality_output ...
    Sybase Server Object Collector error: table : sysindexes
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.
    Sybase Server Object Collector error: table : sysindexes
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.
    Sybase Server Object Collector error: table : exposure_array
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.
    Sybase Server Object Collector error: table : mortality_rate_table
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.
    Converting procedure Mortality.dbo.proc_study_work_1 ...
    Sybase Server Object Collector error: table : study_working
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.
    Sybase Server Object Collector error: table : study_working
         [Native Error code: 207]
    [DataDirect ADO Sybase Provider] Invalid column name 'fill_factor'.
         Error occurred while loading content.

    Hi,
    Even I am getting the same error when trying to see the table structure in sybase from SSMA tool. 
    Sybase Server Object Collector error: table : EFTArchive_bk2
         Invalid column name 'fill_factor'.
         Error occurred while loading content.
    I am not sure how to fix this. 
    This answer doesn't help me. "In SQL Server 2005 the fill_factor is spelled as FILLFACTOR." As I am
    getting this error sybase database itself.  
    I am using SSMA to migrate data from sybase to sql. when I select the tables in sybase, I am getting
    above error. (Invalid column name "fill_factor") 
    Could some please help me how to fix this error?

  • Fact Table loading in parallel

    Hi
    I have 3 fact tables which loads daily 300,000 records and runs in sequence . now i want to run these 3 fact tables load in parallel .
    if i run these 3 fact table load in parallel will there be any performance impact on running quries ?
    regards
    Srinivas

    Hello,
    I have had a case once where the parallel mechanism in SSIS was consuming so much memory that the pacakge failed every now and then. I have had to revert and make the tasks run sequentially. Luckily this is done simply by joining them in the BI designer.
    After that the package no longer failed. In short the impact is not so much on the SQL server engine running the queries, but on the System that runs the SSIS package and consumes too much memory.
    Jan D'Hondt - SQL server BI development

  • Fact table usage is not appropriate

    Hi All,
    I am new to OBIEE 11g, we have 4 fact tables(F1, F2, F3, F4) that shares common 5 Dimensions(D1, D2, D3, D4, D5) and they are joined as below
    F1-D1, F1-D2, F1-D3, F1-D4, F1-D5
    and similarly all other facts(F2, F3, F4) are joined as above
    problem is when we run the report with prompts, let say we created two choice list prompts(P1, P2), P1 with D1.Col1 column and filtering prompt values based on D1.Col12 to populate choice list, find SQL below
    SELECT "D1"."Col1" FROM "Sales SA" WHERE  "D1"."Col2"='North Zone'
    based on the above prompt P1 we are restricting the choice list values of prompt P2 by setting Limit values by as P1, when we select a value from prompt P1 and click on P2 prompt it is showing blank i.e. results is NULL.
    What I have noticed is, it is joining F4 fact table to get the data, checked the logical and physical queries of P2 prompt
    Logical Query :
    SELECT "D2"."COL1" saw_0 FROM "Sales AS" WHERE "D1"."COL2" = 'North Zone' ORDER BY saw_0
    Physical Query :
    select distinct T560319.CO1 as c1
    from
    D1 T560319 / Dim_D1 */ ,*
    D2 T560407 / Dim_D2 */ ,*
    F4 T562764 / Fact_F4 */*
    where  ( T560319.COL1 = T562764.COL1 and T560407.COL3 = T562764.COL2 and T560407.COL2 = 'North Zone')
    order by c1
    actually it should join the F3 fact table to populate the values of P2 choice list, but is joining F4 fact table
    not sure where the problem is, can somebody help in resolving this problem.
    Thanks,
    Sumanth

    Try by setting implesit fact table. You need to choose any fact table column or measure
    Subject area-> properties
    I'm assuming you have one logical fact table with 4 Logical Table sources

  • FAct TABLE LOOKUPs data

    Hi,
    Please help me out in loading the fact tables
    I had used lookup on DIM table to get my SUK and if I use union transformation to get the out put from each lookup and then loading the data with some condition the data in my fact is not loading in a proper format.
    The union transformation is splitting the out put in to different records
    Please do inform me about which transformation should be used to get the data from lookup tables.
    Or please do inform me the approach to load the fact table in SSIS.
    I’m basically INFORMATICA resource and I’m implementing in terms of INFORMATICA    

    Hi, glad to see your reply. I am encountering almost the same problem, loading fact table, 
    My Dataflow is  like:
    Source Component -->LKP1(get Dim1 SUK) -->LKP2(get Dim2 SUK) -->LKn(getDimn SUK) ...-->Destination Component(load to fact table database), while i have tough difficulties:
    [FactoryLookup [352]] Error: Row yielded no match during lookup. 
    [FactoryLookup [352]] Error: The "component "FactoryLookup" (352)" failed because error code 0xC020901E occurred, and the error row disposition on "output "Lookup Output" (354)" specifies failure on error. An error occurred on the specified object of the specified
    component. 
    [DTS.Pipeline] Error: The ProcessInput method on component "FactoryLookup" (352) failed with error code 0xC0209029. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will
    cause the Data Flow task to stop running. 
    [DTS.Pipeline] Error: Thread "WorkThread0" has exited with error code 0xC0209029. 
    Could you please help me? How to fix them?

  • Fact table with 2 time keys, measures showing together in the same report

    Hello,
    I am using OBI EE and I have the following scenario: a fact table hold information about enquiries. An enquiry may or may not generate an appointment. So in my fact table I have two date columns: enquiry date and appointment booked date (not the date of the appointment itself, but when it was actually booked).
    This raises a couple of questions. First question is: I can only have one logical FK to the Times table, how to create two LFKs for those 2 dates? Should I create a logical copy of the Times table in the BMM, along with another time dimension?
    Second question is how to display both pieces of data in the same report. For instance, in a summary report per month I want to see the number of enquiries made and appointments booked in each month. Most likely they will be different numbers and refer to different rows in the database. What is the best way to model this in the BMM?
    For instance, in October there were 10 enquiries, 8 of them were converted into appointments along with 3 enquires made in September. So, the report should show for October: number of enquires: 10, number of appointments: 11 (8 from October + 3 from September)
    Sorry if this is a basic question but I couldn't find around any examples of this scenario.
    Thanks,
    Luis

    Genius, that works perfectly, thanks!
    Just one issue that I noticed... I have other dimensions on that fact table, one of them is "channel". Channel is linked to a column in the original fact table, as is Number of Enquiries.
    If I include Channel in a report that shows Number of Enquiries and Number of Appointments, the Number of Appointments column only shows zeros, while the Number of Enquiries column still shows the correct numbers:
    Month    Channel   Enquiries   Appointments
    Jan 09   Email      100           0
             Phone      120           0
    Feb 09   Email       87           0
    ...Then I figured out that I needed to add a PFK for all dimensions to the aliased fact table, not only for the times dimension.
    Thanks again
    Luis

  • Dynamic Bands on Fact Table measure

    I'm trying to create income bands on my fact table, not sure how to go about it or if its possible.
    I have a fact table that consists of
    Date, TranType, AdvKey, AdvGrpKey, Amount
    Each Adviser belongs to an AdvGrp. 
    I want to be able to group on AdvKey or AdvGrpKey and have the summed amounts (income) allocated to income bands.
    So when I group on Adviser, they will be assigned an income band, ie 0-10k, 10-50k, 50-100k, same applies when the grouping is changed to the Group Level.
    The facttable has about 2 million rows.
    The income is how much is generated from the advisers and adviser group, so this will change over time.
    Can this be done and can it be done dynamically.
    I can't think of any way to do it with a dimension, as there is no way to link back to the fact table.
    Any ideas on how to solve this would be much appreciated.
    Thanks
    Jon

    Hi Richard,
    Thanks for taking the time to respond to my query.
    I'm struggling to work out what your query is doing, and how to use it.
    So I took your query and replaced bits of it with my data, however the output is not as expected.
    While I try to work out what is going on, I'm hoping you happen to read this first, and might be so kind as to throw me a few pointers.
    I tweaked my fact table to only have AdvKey now. The parent child relationship is in the DimIFADetails now, which is the Advisor Group level and the Adviser level. The query below is looking at the Advisor Group level.
    with
    member measures.NewAmount as Measures.Amount * -1
    member measures.WTH as (MyGroups.item(Measures.r),Measures.MyRange)
    member measures.MyRange as
    cstr(round(Measures.NewAmount/10000,0)*10000)+"-"+cstr(round(Measures.NewAmount/1000+1,0)*10000-1)
    set MyGroups as
    Order(nonempty([Dim IFA Details].[Parent Key].[Adviser Group], Measures.NewAmount)
    ,Measures.MyRange, BASC)
    member measures.r as rank([Dim IFA Details].[Parent Key], MyGroups)
    member measures.RangeTot as iif((MyGroups.item(Measures.r-2),Measures.MyRange) = Measures.MyRange ,
    Measures.NewAmount +(Measures.RangeTot,MyGroups.item(Measures.r-2)),
    Measures.NewAmount)
    member Measures.RangeTotal as
    iif((MyGroups.item(Measures.r),Measures.MyRange)=Measures.MyRange,
    null,Measures.RangeTot)
    select {Measures.MyRange,Measures.RangeTotal
    , measures.newamount, measures.r, measures.WTH
    } on 0,
    nonempty(MyGroups,Measures.RangeTotal) on 1
    from
    [Income and Emails Cube]
    My Amount field is negative and shouldnt be so I added a new measure to deal with it now.
    Below are the results I am getting
    New amount is the summed amount of my adviser groups, the value I wish to put in bands.
    The new amount falls in the correct MyRange, so thats good.
    But its generating too many MyRange values ie the first six rows and fall into the first MyRange.
    Not sure what is going on with RangeTotal.
    I put up the other columns hoping it might shed some light, but at this point, I'm a little lost.
    I want to be able to switch between showing Advisers and Adviser Groups, and display the bands.
    I'm hoping you might hand hold me through this.
    Regards
    Jon

  • Using WHERE NOT EXISTS for a Fact Table Load

    I'm trying to set up a fact table load using T SQL, and I need to use WHERE NOT EXISTS. All of the fields from the fact table are listed in the WHERE NOT EXISTS clause. What I expect is that if the value of any one of the fields is different, that the whole
    record be treated as a new record, and inserted into the table. However, in my testing, when I 'force' a field value, new records are not inserted.
    The following is my query:
    declare 
    @Created_By nchar(50)
    ,@Created_Date datetime --do we need utc check?
    ,@Updated_By nchar(50)
    ,@Updated_Date datetime
    select @Created_By = system_user
    ,@Created_Date = getdate()
    ,@Updated_By = system_user
    ,@Updated_Date = getdate()
    insert fact.Appointment
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    select distinct
    Slot.Slot_ID 
    , Slot.Slot_Start_DateTime  as Slot_DateTime --???
    , Slot.Slot_Start_DateTime
    , Slot.Slot_End_DateTime
    , datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) as Slot_Duration_Min 
    , Slot.Created_Date as Slot_CreateDateTime
    , SlotCreateDate.Date_key as Slot_CreateDate_DateKey
    , HSite.Healthcare_System_ID
    , HSite.Healthcare_Service_ID
    , HSite.Healthcare_Service_ID as Healthcare_Supervising_Service_ID
    , HSite.Healthcare_Site_ID 
    , Ref.Booked_Appt_ID 
    , ApptSubmissionTime.Date_key as Appt_Notification_Submission_DateKey
    , ApptCompletionTime.Date_key as Appt_Notification_Completion_DateKey
    , datediff(mi,appt.SubmissionTime,appt.CompletionTime) as Appt_Notification_Duration
    , Appt.Appt_Notification_ID 
    , pat.Patient_ID 
    , 0 as Physician_ID
    , ref.Referral_ID
    , Hsrv.Specialty
    , appt.[Language] as LanguageRequested
    ,@Created_Date as Created_Date
    ,@Created_By as Created_By
    ,@Updated_Date as Updated_Date
    ,@Updated_By as Updated_By
    from dim.Healthcare_System HSys
    inner join dim.Healthcare_Service HSrv
    on HSys.Healthcare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Healthcare_Site HSite
    on HSite.HealthCare_Service_ID = HSrv.Healthcare_Service_ID
    and HSite.HealthCare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Referral Ref 
    on Ref.ReferralSite_ID = HSite.Site_ID
    and Ref.ReferralService_ID = HSite.Service_ID
    and Ref.ReferralSystem_ID = HSite.System_ID 
    right join (select distinct Slot_ID, Source_Slot_ID, Slot_Start_DateTime, Slot_End_DateTime, Created_Date from dim.slot)slot
    on ref.Source_Slot_ID = slot.Source_Slot_ID
    inner join dim.Appointment_Notification appt
    on appt.System_ID = HSys.System_ID
    inner join dim.Patient pat 
    on pat.Source_Patient_ID = appt.Source_Patient_ID
    inner join dim.SystemUser SysUser
    on SysUser.Healthcare_System_ID = HSys.Healthcare_System_ID
    left join dim.Calendar SlotCreateDate
    on SlotCreateDate.Full_DateTime = cast(Slot.Created_Date as smalldatetime)
    left join dim.Calendar ApptSubmissionTime
    on ApptSubmissionTime.Full_DateTime = cast(appt.SubmissionTime as smalldatetime)
    left join dim.Calendar ApptCompletionTime
    on ApptCompletionTime.Full_DateTime = cast(appt.CompletionTime as smalldatetime)
    where not exists
    select
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    from fact.Appointment
    I don't have any issues with the initial insert, but records are not inserted on subsequent inserts when one of the WHERE NOT EXISTS field values changes.
    What am I doing wrong?
    Thank you for your help.
    cdun2

    so I set up a WHERE NOT EXIST condition as shown below. I ran the query, then updated Slot_Duration_Min to 5. Some of the Slot_Duration_Min values resolve to 15. What I expect is that when I run the query again, that the records where Slot_Duration_Min resolves
    to 15 should be inserted again, but they are not. I am using or with the conditions in the WHERE clause because if any one of the values is different, then a new record needs to be inserted:
    declare 
    @Created_By nchar(50)
    ,@Created_Date datetime
    ,@Updated_By nchar(50)
    ,@Updated_Date datetime
    select
    @Created_By = system_user
    ,@Created_Date = getdate()
    ,@Updated_By = system_user
    ,@Updated_Date = getdate()
    insert fact.Appointment
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    select distinct
    Slot.Slot_ID 
    , Slot.Slot_Start_DateTime  as Slot_DateTime --???
    , Slot.Slot_Start_DateTime
    , Slot.Slot_End_DateTime
    , datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) as Slot_Duration_Min 
    , Slot.Created_Date as Slot_CreateDateTime
    , SlotCreateDate.Date_key as Slot_CreateDate_DateKey
    , HSite.Healthcare_System_ID
    , HSite.Healthcare_Service_ID
    , HSite.Healthcare_Service_ID as Healthcare_Supervising_Service_ID
    , HSite.Healthcare_Site_ID 
    , Ref.Booked_Appt_ID 
    , ApptSubmissionTime.Date_key as Appt_Notification_Submission_DateKey
    , ApptCompletionTime.Date_key as Appt_Notification_Completion_DateKey
    , datediff(mi,appt.SubmissionTime,appt.CompletionTime) as Appt_Notification_Duration
    , Appt.Appt_Notification_ID 
    , pat.Patient_ID 
    , 0 as Physician_ID
    , ref.Referral_ID
    , Hsrv.Specialty
    , appt.[Language] as LanguageRequested
    ,@Created_Date as Created_Date
    ,@Created_By as Created_By
    ,@Updated_Date as Updated_Date
    ,@Updated_By as Updated_By
    from dim.Healthcare_System HSys
    inner join dim.Healthcare_Service HSrv
    on HSys.Healthcare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Healthcare_Site HSite
    on HSite.HealthCare_Service_ID = HSrv.Healthcare_Service_ID
    and HSite.HealthCare_System_ID = HSrv.HealthCare_System_ID 
    inner join dim.Referral Ref 
    on Ref.ReferralSite_ID = HSite.Site_ID
    and Ref.ReferralService_ID = HSite.Service_ID
    and Ref.ReferralSystem_ID = HSite.System_ID 
    right join (select distinct Slot_ID, Source_Slot_ID, Slot_Start_DateTime, Slot_End_DateTime, Created_Date from dim.slot)slot
    on ref.Source_Slot_ID = slot.Source_Slot_ID
    inner join dim.Appointment_Notification appt
    on appt.System_ID = HSys.System_ID
    inner join dim.Patient pat 
    on pat.Source_Patient_ID = appt.Source_Patient_ID
    inner join dim.SystemUser SysUser
    on SysUser.Healthcare_System_ID = HSys.Healthcare_System_ID
    left join dim.Calendar SlotCreateDate
    on SlotCreateDate.Full_DateTime = cast(Slot.Created_Date as smalldatetime)
    left join dim.Calendar ApptSubmissionTime
    on ApptSubmissionTime.Full_DateTime = cast(appt.SubmissionTime as smalldatetime)
    left join dim.Calendar ApptCompletionTime
    on ApptCompletionTime.Full_DateTime = cast(appt.CompletionTime as smalldatetime)
    where not exists
    select
    Slot_ID
    , Slot_DateTime
    , Slot_StartDateTime
    , Slot_EndDateTime
    , Slot_Duration_min
    , Slot_CreateDateTime
    , Slot_CreateDate_DateKey
    , Healthcare_System_ID
    , Healthcare_Service_ID
    , Healthcare_Supervising_Service_ID
    , Healthcare_Site_ID
    , Booked_Appt_ID
    , Appt_Notification_Submission_DateKey
    , Appt_Notification_Completion_DateKey
    , Appt_Notification_Duration
    , Appt_Notification_ID
    , Patient_ID
    , Physician_ID
    , Referral_ID
    , Specialty
    , LanguageRequested
    , Created_Date
    , Created_By
    , Updated_Date
    , Updated_By
    from fact.Appointment fact
    where 
    Slot.Slot_ID  = fact.Slot_ID 
    or
    Slot.Slot_Start_DateTime   = fact.Slot_DateTime  
    or
    Slot.Slot_Start_DateTime = fact.Slot_StartDateTime
    or
    Slot.Slot_End_DateTime = fact.Slot_EndDateTime
    or
    datediff(mi,slot.Slot_Start_DateTime,slot.Slot_End_Datetime) =
    fact.Slot_Duration_min
    or
    Slot.Created_Date  = fact.Slot_CreateDateTime
    or
    SlotCreateDate.Date_key = fact.Slot_CreateDate_DateKey
    or
    HSite.Healthcare_System_ID = fact.Healthcare_System_ID
    or
    HSite.Healthcare_Service_ID = fact.Healthcare_Service_ID
    or
    HSite.Healthcare_Service_ID  =
    fact.Healthcare_Service_ID 
    or
    HSite.Healthcare_Site_ID  = fact.Healthcare_Site_ID 
    or
    Ref.Booked_Appt_ID  = fact.Booked_Appt_ID 
    or
    ApptSubmissionTime.Date_key =
    fact.Appt_Notification_Submission_DateKey
    or
    ApptCompletionTime.Date_key =
    fact.Appt_Notification_Completion_DateKey
    or 
    datediff(mi,appt.SubmissionTime,appt.CompletionTime)  = fact.Appt_Notification_Duration
    or
    Appt.Appt_Notification_ID = fact.Appt_Notification_ID 
    or
    pat.Patient_ID  =
    fact.Patient_ID 
    or
    0 = 0
    or
    ref.Referral_ID = fact.Referral_ID
    or
    Hsrv.Specialty = fact.Specialty
    or
    appt.[Language] = fact.LanguageRequested

  • Load data from dimensions to fact table

    Hi,
    I have 10 dimension tables and one fact table. now i want to load data in to fact table from dimensions table. how i can do that.
    Regards,
    joy

    To elaborate on "Mallee"'s answer, it's not good practice to load dimensional data into a fact table.
    I guess what you mean is how to refer to dimensions when loading a fact table.
    Simply refer to dimensions using lookups on the necessary dimensions, the lookup needs to be on the natural key you have that links facts to dimensions. Don't forget to use the dimension's surrogate key though when populating the fact table's foreign key columns pointing at the dimensions.
    Hope this helps.
    Cheers, Patrick

Maybe you are looking for