Pulling values from Variables for my Fact Table

Hi All,
The Load_Date in my Fact table is currently, current_timestamp-1, as the data is one day old when it is being loaded. I want to get that date from a variable because if I need to rerun with an earlier date like 20 or 30 days before the current date, I do not want to touch the mapping instead modify the variable and run the package. Please advise on how to do this?
Thanks for your time and help.

As Bhabani said, create a project variable with the code you would like to run to generate the earlier date. For example, "select current_timestamp - 30". Then, add this variable to the Package before the Interface, setting it to refresh. In the Interface, change the mapping from what it is now (current_timestamp - 1) to the variable (#VARIABLE_NAME). The variable will now be refreshed and the value added to the mapping.
If you want to change it to "current_timestamp - 20", just update the variable.
Regards,
Michael Rainey

Similar Messages

  • Can COPA pull values from material classification tables

    Hi All,
    I know COPA can pull values from standard SAP tables like material master tables (e.g. MARA) but can it also pull values from material classification table(s)?
    Your help is greatly appreciated,
    Points will be rewarded

    Hi Kati,
    In order to derive CO-PA chars from material classification view for a
    specific material value you have to implement the CO-PA derivation exit
    (include ZXKKEU11) accordingly. It's indeed table AUSP from which you
    can get the corresponding value (field ATWRT) for each classifying
    attribute (field ATINN). In order to find out the field name for each
    ATINN number (so that the mapping to corresponding CO-PA chars can be
    done in a sensible way) you have to select additionally the ATNAM value
    from table CABN (for given ATINN number).
    BR,
    MLM

  • "Select" Physical table as LTS for a Fact table

    Hi,
    I am very new to OBIEE, still in the learning phase.
    Scenario 1:
    I have a "Select" Physical table which is joined (inner join) to a Fact table in the Physical layer. I have other dimensions joined to this fact table.
    In BMM, I created a logical table for the fact table with 2 Logical Table Sources (the fact table & the select physical table). No errors in the consistency check.
    When I create an analysis with columns from the fact table and the select table, I don't see any data for the select table column.
    Scenario 2:
    In this scenario, I created an inner join between "Select" physical table and a Dimension table instead of the Fact table.
    In BMM, I created a logical table for the dimension table with 2 Logical Table Sources (the dimension table & the select physical table). No errors in the consistency check.
    When I create an analysis with columns from the dimension table and the select table, I see data for all the columns.
    What am I missing here? Why is it not working in first scenario?
    Any help is greatly appreciated.
    Thanks,
    SP

    Hi,
    If I understand your description correctly, then your materialized view skips some dimensions (infrequent ones). However, when you reference these skipped dimensions in filters, the queries are hitting the materialized view and failing as these values do not exist. In this case, you could resolve it as follows
    1. Create dimensional hierarchies for all dimensions.
    2. In the fact table's logical sources set the content tabs properly. (Yes, I think this is it).
    When you skipped some dimensions, the grain of the new fact source (the materialized view in this case) is changed. For example:
    Say a fact is available with the keys for Product, Customer, Promotion dimensions. The grain for this is Product * Customer * Promotion
    Say another fact is available with the keys for Product, Customer. The grain for this is Product * Customer (In fact, I would say it is Product * Customer * Promotion Total).
    So in the second case, the grain of the table is changed. So setting appropriate content levels for these sources would automatically switch the sources.
    So, I request you to try these settings and let me know if it works.
    Thank you,
    Dhar

  • Inserting values from a cursor to a table

    Hi,
    I need to insert the values from a cursor into a table,this i the part of code which trieds to do it...i get error stating "select stmt missing"...pls help out...
    OPEN  p_cursor for V_SQLSTATEMENT;
            ---for i in p_cursor
            LOOP
              FETCH p_cursor INTO v_cursor_type;      
              insert into TEMPCHARTVALUES(HOP,AMOUNT,EFFECTIVE_FROM,EFFECTIVE_TO,CURRENCY)
                   values (v_cursor_type.PMC1_HOP_CODE,
                         v_cursor_type.PMC1_Amount,
                         v_cursor_type.PMC1_EFFECTIVE_FROM,
                         v_cursor_type.PMC1_EFFECTIVE_UPTO,
                         v_cursor_type.PMC1_CURRENCY);
                                                           --dbms_output.put_line(v_cursor_type.KEYCODE1);
              EXIT WHEN p_cursor%ROWCOUNT = v_REC_COUNT;
              end loop;

    Hi, here it is..
    create or replace
    procedure  prm_sp_charts_db (P_CURSOR OUT SYS_REFCURSOR,CHARTCode VARCHAR,tablename varchar)
    IS
    v_COUNT varchar2(200);
    v_REC_COUNT NUMBER;
    V_SQLSTATEMENT VARCHAR2(2000);
    v_cursor_type  TEMPCHARTVALUES%ROWTYPE;
        begin
         v_COUNT:='SELECT COUNT(*) FROM PRM_M_Chart_' || CHARTCode;
         execute immediate v_COUNT into v_REC_COUNT;
         V_SQLSTATEMENT := 'SELECT ';
         V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F1_CODE Keycode1,';
          open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F2_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F2_CODE Keycode2,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F3_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F3_CODE Keycode3,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
           open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F4_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F4_CODE Keycode4,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F5_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F5_CODE Keycode5,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          --open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F6_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F6_CODE Keycode6,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          --open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F7_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F7_CODE Keycode7,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          --open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F8_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F8_CODE Keycode8,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          --open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F9_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F9_CODE Keycode9,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          --open  P_CURSOR for select column_name from  user_tab_columns where table_name=tablename and column_name='PMC' || CHARTCode || '_F10_CODE';
          IF P_CURSOR%FOUND then
          V_SQLSTATEMENT := V_SQLSTATEMENT || 'PMC' || CHARTCode || '_F10_CODE Keycode10,';
          else
          V_SQLSTATEMENT := V_SQLSTATEMENT || '0,';
          END IF;
          V_SQLSTATEMENT := V_SQLSTATEMENT ||'PMC' || CHARTCode || '_HOP_CODE HOPCode,PMC' || CHARTCode || '_AMOUNT ,PMC'|| CHARTCode || '_EFFECTIVE_FROM Effective_From,PMC' || CHARTCode || '_EFFECTIVE_UPTO Effective_Upto,PMC' || CHARTCode || '_CURRENCY Currency FROM PRM_M_CHART_' || CHARTCode ;
          DBMS_OUTPUT.PUT_LINE(V_SQLSTATEMENT);
           OPEN  p_cursor for V_SQLSTATEMENT;
            ---for i in p_cursor
            LOOP
              FETCH p_cursor INTO v_cursor_type;      
              insert into TEMPCHARTVALUES(HOP,AMOUNT,EFFECTIVE_FROM,EFFECTIVE_TO,CURRENCY)
                   values (v_cursor_type.PMC1_HOP_CODE,
                         v_cursor_type.PMC1_Amount,
                         v_cursor_type.PMC1_EFFECTIVE_FROM,
                         v_cursor_type.PMC1_EFFECTIVE_UPTO,
                         v_cursor_type.PMC1_CURRENCY);
                                                           --dbms_output.put_line(v_cursor_type.KEYCODE1);
              EXIT WHEN p_cursor%ROWCOUNT = v_REC_COUNT;
              end loop;
    end prm_sp_charts_db;

  • ETL for loading Fact tables

    Hi all
    I have a fundamental question regarding loading records into the Fact tables. As you know we always load Dimensions before loading Facts. In our data model, for most of the Fact tables we have a special Dimension that has got the basic attributes in it, along with the source key of the records which are valid in terms of our data warehouse. The source of the Fact table includes the source tables which are involved in loading the Dimension as well.
    For example for Student Fact table we have a Student Dimension which is loaded before Student Fact, hence has got the most recent changes (source key of the records which are to be loaded into DW). Now my question is that which options below are more appropriate in loading Student Fact table.
    Option 1 -  Load Student Fact table using the same source tables that are used in loading records into Student Dimension, ignoring the similar logic has been applied already in Dimension to get valid records from Source and do it again in Fact job.
    Option 2 -  Inner Join the Student Dimension in the Student Fact ETL job, so it limits the number of source records (coming from Source System) to the validated records which we are interested to load into DW. This option makes loading the Fact table faster, as by contributing the Dimension in loading its corresponding Fact, we don't have to get all records from the source and validate them against the rules again (as it has been done in the Dimension job and now we can use the validated record IDs in Fact job).
    As we are new building jobs for a dimensional model, I thought it would be good to ask your opinions and your experience
    Thanks in advance,
    Tootia

    I don't see any problem with re-using your "which students do we care about?" logic and rules by borrowing the list of students from the dimension table. You can join to it, or do a lookup() into it and then filter-out nulls (assuming you return a null on a no-match), or use a Validation transform with the "Exists in table" option -- which to use is question of style & performance -- any would work.  Indeed, when migrating data into SAP using iDocs, I use a similar idea, always joining the iDoc base segment "map" table to the load of any child segment table to "automatically" filter-out any child segment records not present in the base, re-using the selection logic as you suggest, which then only needs to be built in the base segment. Keeps things tidy.
    Best wishes,
    Jeff Prenevost
    Data Services Practice Manager
    itelligence

  • Logical level for logical fact table sources

    it is clear that for fact aggregates, we should use the Content tab of the Logical Table Source dialog to assign the correct logical level to each dimension.
    question is : is it mandatory to assign even for non-aggregates fact tables the logical level for each dimension (which normally should be set to the most detailed level of each dimension) ? is it any known issue if "logical levels"in content tab are not set ?
    the reason I'm asking this is a strange bug I have (I'm not going to discuss it here) and then only workaround seems to be NOT setting the logical levels (on content tab) for logical fact table sources.
    thank you !

    If levels are not set: By default levels are considered as lowest level
    It should not matter if you set or not
    Generally we set for facts explicitly when we are using Aggregate tables.
    Your current issue might be a case by case; I would suggest to check implicit fact, any table mapped to the source to force a join etc
    Mark if helps
    Let me know how it helps
    Edited by: Srini VEERAVALLI on Feb 5, 2013 8:33 AM
    Any updates on this?+_
    Edited by: Srini VEERAVALLI on Feb 14, 2013 9:09 AM

  • Content tab for a fact table

    Hi
    Please , help me in knowing the use of content tab for a fact table in the repository in OBIEE.
    Thanks.

    if you have multiple LTS then you should set the content level approprately otherwise you can get errors during consistency checks.not able to find any link which talks only about content level.see these links and let us know if you have any doubts
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=604637
    Content tab is also handy when you are using aggregate tables.
    Regards,
    Sandeep

  • Error for the fact table while processing the cube - attribute key cannot be found when processing

    Please help as I am new to SSAS and this is urgent requirement. This is a MOLAP cube and below is the error that I am receiving when processing the cube. The cube is set to Prrocess Full. Several similar errors are popped up for various dimensions.
    "Errors in the OLAP storage engine: The attribute key cannot be found when processing: Table: 'Fact_Table', Column: 'ID', Value: '1'. The attribute is 'Id'. Errors in the OLAP storage engine: The attribute key was converted to an unknown member because
    the attribute key was not found. Attribute Id of Dimension: 17 - Ves - PoC Cont from Database: DB, Cube: IPNCube, Measure Group: iSrvy, Partition: Partition1, Record: 1."
    Thanks in advance.

    Thanks for the recommendations David.
    It will be really great if you can clear some of my doubts:
    To my information, all the dimensions need to be processed first and then the fact table will be processed.
    So if the ID's are not present in the dimension tables, then it should not be present in the Fact table either.
    Here we found null values in the dimension table and the ID's were present in the Fact table. What might be the reasons causing such situation?
    Also how frequently the cube needs to be processed? Currently the ETL which processes the cube, is scheduled in a SQL Job Agent on hourly basis everyday. 
    Is there any possibilty that the cube might be under processing state and the SQL job for the next run getting executed trying to access and process the cube while it was still processing?

  • Find the partition for the fact table

    Oracle version : Oracle 10.2
    I have one fact table with daily partitions.
    I am inserting some test data in this table for old date 20100101.
    I am able to insert this record in this table as below
    insert into fact_table values (20100101,123,456);
    However I observed that the partition for this date does not exist in the table (all_tab_partitions) morever I am not able to select the data using
    select * from facT_table partition(d_20100101)
    but I am able to extract the data using
    select * from facT_table where date_id=20100101
    could some one please let me know the way to find the partition in which this data might be inserted
    and if the partition for date 20100101 is not present then why insert for that date is working ?

    user507531 wrote:
    However I observed that the partition for this date does not exist in the table (all_tab_partitions) morever I am not able to select the data using
    select * from facT_table partition(d_20100101)Wrong approach.
    but I am able to extract the data using
    select * from facT_table where date_id=20100101Correct approach.
    could some one please let me know the way to find the partition in which this data might be inserted
    and if the partition for date 20100101 is not present then why insert for that date is working ?Who says that the date is invalid..? This is a range partition - which means that each partition covers a range. And if you bothered to read up in the SQL Reference Guide on how a range partition is defined, you will notice that each partition is defined with the end value of the range it covers. There is no start value - as the previous partition's end value is the "+border+" between this and the prior partition.
    I suggest that before you use a database feature you first familiarise yourself with it. Else incorrectly using it, and making the wrong assumptions about it, more than likely results.

  • 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

  • Why Negative values are entering in to fact table.

    Dear All,
    After Data File uploaded. The Fact table is showing Negative values.
    Can any body give solution.
    And in DataManager->Financial Process>FX Restatament (Is running Succussfully)
    But Currency is not getting translated.
    Please help.
    Thanks,
    Satish.

    The reason the values are negative may be caused by 2 items.  The first is the default method by which BPC store information; BPC is designed to store values based on the natural sign.  So, if a Revenue account is positive in the Data File, and the Property "ACCTTYPE" is INC, the value is stored as a negative number.  When an expense value is loaded to an account with "EXP", the value is stored as a positive.  LEQ are Negative and AST are positive. (CREDITS and DEBITS storage)
    BPC then uses tables and measures to report the account based on type correctly in the Excel interface. This is how  BPC is designed. 
    There is also the CREDITPOSITIVE = YES / NO that is part of the Data Transformation instructions, and if this is setup incorrectly, you may store the reverse signs from the data file that is loaded. So this may need to be reviewed as well.
    As for the FXTranslation, I assume you have rates in the RATE cube to use in the translation process. You will need to verify that the RATETYPE property is filled in for the accounts you wish to translate? DId you process the FX script logic and the RATE script logic prior to running FX.
    Hope this helps.
    Edited by: Petar Daniel on Dec 10, 2008 2:20 PM

  • How to pick max value from a column of a table using cursor and iteration

    Hello Everybody
    I have a table loan_detail
    and a column in it loan_amount
    now i want to pick values from this table using cursor and then by using iteration i want to pick max value from it using that cursor
    here is my table
    LOAN_AMOUNT
    100
    200
    300
    400
    500
    5600
    700i was able to do it using simple loop concepts but when i was trying to do this by using cursor i was not able to do it .
    Regards
    Peeyush

    SQL> SELECT MAX(sal) Highest_Sal,MIN(sal) Lowest_Sal FROM emp;
    HIGHEST_SAL LOWEST_SAL
           5000        800
    SQL> set serverout on
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := counter;
    10      counter := counter + 1;
    11    END LOOP;
    12    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    13    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    14  END;
    15  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Even smaller
    SQL> DECLARE
      2    TYPE tmp_tbl IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
      3    sal_tbl tmp_tbl;
      4    CURSOR emp_sal IS
      5      SELECT sal FROM emp;
      6    counter INTEGER := 1;
      7  BEGIN
      8    FOR i IN emp_sal LOOP
      9      sal_tbl(i.sal) := 1;
    10    END LOOP;
    11    DBMS_OUTPUT.put_line('Lowest SAL:' || sal_tbl.FIRST);
    12    DBMS_OUTPUT.put_line('Highest SAL:' || sal_tbl.LAST);
    13  END;
    14  /
    Lowest SAL:800
    Highest SAL:5000
    PL/SQL procedure successfully completed.
    SQL> Edited by: Saubhik on Jan 5, 2011 4:41 PM

  • J2ME error to get value from variable in another class

    hi,,
    i write code for a mobile application like a tour guide..
    i had create 5 class for this application, KutaBeachDictionary MIDlet class, ListMainMenu List class, ListMenuHotel List class, HotelDes01 Form class and the last Hotel class that store all information.
    the problem is, i have [choose] variable in ListMenuHotel that contain getSelectedIndex() value, i want to take [choose] value from ListMenuHotel class to [index] variable in HotelDes01, so it determine the name of hotel that will display in form.but the index always 0 although i had choosen different menu from ListMenuHotel..
    here is all code
    in MIDlet class
    import javax.microedition.lcdui.Alert;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.midlet.MIDlet;
    public class KutaBeachDictionary extends MIDlet {
        public KutaBeachDictionary() {
            lstMenuUtama = new ListMenuUtama(this);
            lstMenuHotel = new ListMenuHotel(this);
            htlDes1 = new HotelDes01(this);
            frmLoading = new FormLoading(this);
        public Display getDisplay() {
            return Display.getDisplay(this);
        public void exitMIDlet() {
            switchDisplayable(null, null);
            destroyApp(true);
            notifyDestroyed();
        public void startApp() {
            if (midletPaused) {
                resumeMIDlet();
            } else {
                initialize();
                startMIDlet();
            midletPaused = false;
            getDisplay().setCurrent(frmLoading);
            new Thread(frmLoading).start();
            frmLoading.done = false;
            frmLoading.gLoading.setValue(0);
        public void pauseApp() {
            midletPaused = true;
        public void destroyApp(boolean unconditional) {
        private boolean midletPaused = false;
        public ListMenuHotel lstMenuHotel;
        public ListMenuRestaurant lstMenuRestaurant;
        ListMenuUtama lstMenuUtama;
        FormAbout frmAbout;
        public HotelDes01 htlDes1;
        FormLoading frmLoading;
    }the code in ListMenuHotel
    import java.io.IOException;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.List;
    import javax.microedition.lcdui.Ticker;
    public class ListMenuHotel extends List implements CommandListener {
        Hotel objHotel = new Hotel();
        ListMenuHotel(KutaBeachDictionary run) {
            super("List Hotel", List.IMPLICIT);
            this.run = run;
            try {
                btnImage = Image.createImage("/btnImage.png");
            } catch (IOException e) {
            tickerMenu = new Ticker("Daftar Hotel di Pantai Kuta Bali");
            setTicker(tickerMenu);
            for (int i = 0; i < objHotel.namaHotels.length; i++) {
                append(objHotel.namaHotels, btnImage);
    addCommand(new Command("Select", Command.OK, 0));
    addCommand(new Command("Back", Command.BACK, 0));
    setCommandListener(this);
    public void commandAction(Command cmd, Displayable dsp) {
    if (cmd == SELECT_COMMAND) {
    choose = getSelectedIndex();
    Display.getDisplay(run).setCurrent(run.htlDes1);
    switch (cmd.getCommandType()) {
    case Command.BACK:
    Display.getDisplay(run).setCurrent(run.lstMenuUtama);
    break;
    public int getChoose() {return choose;}
    private KutaBeachDictionary run;
    private Image btnImage;
    private Ticker tickerMenu;
    private int choose;
    the code in HotelDes01 Form classimport java.io.IOException;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.ImageItem;
    public class HotelDes01 extends Form implements CommandListener {
    private KutaBeachDictionary run;
    private int index;
    private Hotel isiHotel = new Hotel();
    public HotelDes01(KutaBeachDictionary run) {
    super("Inna Kuta Hotel");
    index = run.lstMenuHotel.getChoose(); //here is the problem..the value remain 0 althought i choose another??!!
    this.run = run;
    Image imgHotel = null;
    String namaHotel = "\n" + isiHotel.namaHotels[index] + "\n";
    try {
    imgHotel = Image.createImage("/HotelImage/interface/htlDes1.png");
    } catch (IOException e) {
    append(new ImageItem(null, imgHotel, ImageItem.LAYOUT_CENTER, null));
    append(namaHotel);
    addCommand(new Command("Back", Command.BACK, 0));
    setCommandListener(this);
    public void commandAction(Command cmd, Displayable dsp) {
    switch (cmd.getCommandType()) {
    case Command.BACK:
    Display.getDisplay(run).setCurrent(run.lstMenuHotel);
    break;
    can someone fix the code,, i had tried so many ways,,but completely failure.. T_T
    Edited by: diaca on Mar 22, 2010 7:55 AM
    Edited by: diaca on Mar 22, 2010 8:01 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    hei bro,i had solved the problem :)
    the problem is , i had constructed the form of hotelDes01 each time the program starting with this code
    public class KutaBeachDictionary extends MIDlet {
        public KutaBeachDictionary() {
            //.. declaring several new object
            htlDes1 = new HotelDes01(this);
        //..another procedure like startApp, pauseApp, etc
    public HotelDes01 htlDes1;
    }i think if i declare this class in the beginning it never updated the index value
    so i delete the code above, and i declare the htlDes1 in the listMenuHotel like this:
    public class ListMenuHotel extends List implements CommandListener {
        //..several code just like before
    public void commandAction(Command cmd, Displayable dsp) {
            if (cmd == cmdSelect) {
               objHotel.setChoose(getSelectedIndex()); //i change the code like this
               showInformation();
            if (cmd == cmdBack) {
                Display.getDisplay(run).setCurrent(run.lstMenuUtama);
        public void showInformation() {
            HotelDescription htlDes1 = new HotelDescription(run); //reconstruct the object in the class ListMenuHotel
            Display.getDisplay(run).setCurrent(htlDes1); //display the object
        }so the form of hotelDes01 now always reconstruct whenever user change the election in ListMenuHotel class and now index value get updated.. :D
    thanks for trying to fix the code qnat..
    this is my coursework, so i get to finish it ASAP..

  • Issue with Multiple LTS for a fact table and filters

    Hello,
    I am facing an issue with obiee 10g.
    In my model, I have a huge FACT table F1 (partitioned and indexed). The average response time for the queries, which targeted it, was ~30-60 seconds, which was not really convincing our end user.
    So, we decided to create a materialized view, which removes some dimensions that are not used by default, but might be used if the end user adds some filters. I added the Materialized view in the Physical Layer and in the corresponding Logical Table Source.
    I then tried to see if it works, but I was a bit surprised by the result. Indeed,
    -> If the report does not reference a truncated dimension, it targets the materialized view. -> Perfect
    -> If the report does reference a truncated dimension in the columns, it targets the Fact Table. -> Perfect
    -> If the report does reference a truncated dimension in the Filters, it targets the materialized view. For this reason, the filter is never resolved and no join on the dimension table is applied, whereas it exists in logical SQL generated. -> Ko.
    A suggestion could be to add the filters into the columns, but I am not satisfied by this response because it will never use the materialized view in that case.
    An other suggestion could be to use query rewrite, but I 'd like to have the full control on the generation of the queries.
    Does someone know if the filters are not evaluated to determine which LTS to use? How can I force this evaluation?
    Regards,

    Hi,
    If I understand your description correctly, then your materialized view skips some dimensions (infrequent ones). However, when you reference these skipped dimensions in filters, the queries are hitting the materialized view and failing as these values do not exist. In this case, you could resolve it as follows
    1. Create dimensional hierarchies for all dimensions.
    2. In the fact table's logical sources set the content tabs properly. (Yes, I think this is it).
    When you skipped some dimensions, the grain of the new fact source (the materialized view in this case) is changed. For example:
    Say a fact is available with the keys for Product, Customer, Promotion dimensions. The grain for this is Product * Customer * Promotion
    Say another fact is available with the keys for Product, Customer. The grain for this is Product * Customer (In fact, I would say it is Product * Customer * Promotion Total).
    So in the second case, the grain of the table is changed. So setting appropriate content levels for these sources would automatically switch the sources.
    So, I request you to try these settings and let me know if it works.
    Thank you,
    Dhar

  • Dimension values without data in a fact table

    I have an ODS system and a Data warehouse system
    I have a Sales fact table in the ODS system and I have these fields:
    SALES
    ID_CUSTOMER (PK),
    ID_MODEL (PK),
    ID_TIME (PK),
    SALES,
    QUANT_ART,
    COST
    Then in some records in the fields ID_Time or ID_Model or ID_Customer I don’t have values (NULL) because in the transactional systems these record don’t have values (NULL).
    The users want to generate aggregate reports with the Sales table...
    The question is:
    I have to put a “dummy” value in the dimensions Customer, Model and Time (for example “0”) and put this value in the fact table if the dimensions fields have NULL values????
    Or I have to leave the NULL values?
    What is the best choice? Why?

    There's often some specific reason why these values don't exist, such as the record being a manual adjustment to sales (for example a journal voucher). In these cases it can be helpful to have a flag column to indicate this, so that when a user comes across a bunch of sales with a Store Name of "Unknown" or "Not Applicable" they can also look at the reason for this unusual entry.

Maybe you are looking for