SCD2 dimensions wrong behavior: same business identifiers on same load

Hello,
We have the requisite (that I would consider normal on a DW project) of keeping history of all the changes that might occur to a specific field on the same day. This field loads into a scd type 2 attribute on a dimension.
Since I have daily loads on my DW, it could happen that, in the same load, different rows with the same business keys exist.
Consider the following scenario:
Table A: id (business identifier), event, dt_event
Table A loads into DIM_A: sk (surrogate key), id, event (trigger history), dt_begin(effective date), dt_end(expiration date)
First Load:
Table A:
1, 'OPEN_PROCESS', '01-06-2008 09:00:00'
1, 'CLOSE_PROCESS', '01-06-2008 15:00:00'
Dimension DIM_A:
1, 1, 'OPEN_PROCESS', '01-06-2008 09:00:00', '01-06-2008 08:59:59' <- Shouldn't be '01-06-2008 14:59:59'?
1, 1, 'CLOSE_PROCESS', '01-06-2008 15:00:00', NULL
Second Load:
Table A
1, 'REOPEN_PROCESS', '02-06-2008 14:00:00'
1, 'CLOSE_PROCESS', '02-06-2008 15:00:00'
Dimension DIM_A:
1, 1, 'OPEN_PROCESS', '01-06-2008 09:00:00', '01-06-2008 08:59:59'
2, 1, 'CLOSE_PROCESS', '01-06-2008 15:00:00', NULL
5, 1, 'REOPEN_PROCESS', '02-06-2008 14:00:00', '02-06-2008 13:59:59' <- Same issue with dates?
where's the new record? I should have 4 registers by now...
The row with sk=2 was updated twice on the last load: first it was updated with a new dt_end (as it should be) and next it was updated once again, keeping dt_end to a null value and sk=2 as my up to date record.
What I would like to have at the end of the second load is something like this:
1, 1, 'OPEN_PROCESS', '01-06-2008 09:00:00', '01-06-2008 14:59:59'
2, 1, 'CLOSE_PROCESS', '01-06-2008 15:00:00', '02-06-2008 13:59:59'
5, 1, 'REOPEN_PROCESS', '02-06-2008 14:00:00', '02-06-2008 14:59:59'
6, 1, 'CLOSE_PROCESS', '02-06-2008 15:00:00', NULL
What can I do to achieve this? Is this a problem with the dimension operator? Has anyone have any issues like this before?
Thank you for all your comments on this.
Regards,
Bruno

Thinking off the top of my head for a possible workaround, perhaps you could use an analytic function to partition the input data set
e.g.
1) Use something like ROW_NUMBER() OVER(PARTITION BY id ORDER BY dt_event ASC) to create a COLUMN data_partition
2) Add a filter to the DIMENSION load that will accept parameter P_DATA_PARTITION and have condition WHERE data_partition = P_DATA_PARTITION. This way you can run dimension load and load first set of changes, then second set etc.
3) Set up a process flow that will run dimension load X number of times with parameter P_DATA_PARTITION = 1 to X. Perhaps you can use the FOR LOOP operator in the Process Flow (I haven't used it so not sure)?
It's not ideal as you're running the same code several times (overhead) and also you need to fix the number of times it runs, unless you can use a function to determine this and pass into FOR LOOP.
Hope this is of some use.
Cheers
Si

Similar Messages

  • Surrogate identifier and Business identifier on Dimensions

    I understand that a surrogate key is useful to do loads/merges data on dimensions
    without affecting natural keys on these operations and to save space on fact tables.
    However beyond from this, I miss understanding about the two concepts above.
    Since in the doc is write: "Every level must have two identifiers: a surrogate identifier and a business identifier." -> Oracle® Warehouse Builder User's Guide
    10g Release 2 (10.2) -> 4 Defining Dimensional Objects
    1 - Why do I need obligatory a surrogate identifier on OWB10r2 ?
    2 - Either do I need specify the same surrogate key in each dimension level
    or ever level must be your own surrogate key ?
    3 - What would be the dimension behavior without them ? Moreover couldn't I have
    the same behavior using business identifier instead ?
    Thank you

    Right.
    However, what do you mean about "attributes that are on the lowest level of a hierarchy" ? This means high cardinality ? (A kind of Unique Key/PK ?)
    So, see this sample (originated from products table's Sales History sample schema )
    prod_id.prod_name........prod_subcategory..prod_category.supplier_id.min_price
    ........5.gurfield& murks...trousers - women....women....................170......137.02
    ......10.gurfield& murks...trousers - women....women....................170......155.93
    ......15.coin pocket twi....trousers and jeans..girls..........................30........12.47
    ......20.and 2 crosscour..shirts - boys...........boys.........................83........13.36
    ......25.and 2 crosscour..shirts - boys...........boys.........................83........13.36
    ......30.and 2 crosscour..shirts - boys...........boys.........................83........13.36
    ......35.kahala pleated ...shorts - men...........men........................125........24.48
    What would be the business identifiers ? (suppler_id ?) If yes, it isn't UK. Or aren't there business identifier here ?
    Now suppose that prod_id be surrogate key, ok ? What I undestand about OWB10g, it would put new keys on this table for every level from dimension
    Look the dimension:
    CREATE DIMENSION products_dim
         LEVEL product           IS (products.prod_id)
         LEVEL subcategory      IS (products.prod_subcategory)
         LEVEL category          IS (products.prod_category)
         HIERARCHY prod_rollup (
              product          CHILD OF
              subcategory      CHILD OF
              category
         ATTRIBUTE product DETERMINES
    (products.prod_name, products.prod_desc,
    prod_weight_class, prod_unit_of_measure,
    prod_pack_size,prod_status, prod_list_price, prod_min_price)
         ATTRIBUTE subcategory DETERMINES
    (prod_subcategory, prod_subcat_desc)
         ATTRIBUTE category DETERMINES
    (prod_category, prod_cat_desc)
    The table will look like:
    SQL> desc products
    Name
    PROD_ID_PROD_ID
    prod_name
    prod_desc
    PROD_SUBCATEGORY_PROD_ID
    prod_subcategory
    prod_subcat_desc
    PROD_CATEGORY_PROD_ID
    prod_category
    prod_cat_desc
    prod_weight_class
    prod_unit_of_measure
    prod_pack_size
    Why OWB do that ?
    Thank you very much for your assistance and you patience
    Marcelo Sinni

  • How to make a copy of a business area in same EUL

    Hi,
    We have a standard BIS eul (which is provided by Oracle as a part of Business Intelligence pack). This EUL is powerful and very useful.
    I want to leverage this EUL as well as do some customization to this eul as per the client's requirements. The issue is -
    How to copy all the Business Areas in same EUL but different Name and identifier (as we do not want to use this in any existing workbooks. However, we want to use this in new workbooks only if the standard BIS eul does not satisfy the report requirement and needs some customisation).
    Let me know if anyone has done this before.
    Thanks,
    HP

    We had that plan as well. But then there are few things which concerns us if we go for 2 eul -
    1) If I take that approach, how can we congifure two eul in e-business suite, so that we can have one standard eul with all the standard workbooks and other custom one.
    2) And if in near future there is any BIS patch then we have to apply it at two places (the patch which might effect the metadata type of tables)
    regards,
    Hp

  • Display Several Sales Orders from Same Business Customer TOGETHER   in MD04

    Hello
    In MD04 is it possible to display several sales orders from same business customer together?
    For instance one business customer order bikes for two times.
    The Order-No are 12912(50st by 07/08/09) and 12913(100st by 10/08/09).
    Normally after runnning of MRP(MD02), the planned orders are displayed seperately in MD04.
    I want to display  two orders together.
    The reason is if some trouble happens in Production(for Ord-no 12912) and it cannot be deliveried on schedule, however Production  (for Ord-no 12913) is going without trouble, the final-products for order 12913 should move for 12912.
    If you have some good solutions, please share it.
    Thank you for your advice.
    Regards,

    Hi Riyolshibashi,
    Lets look at the two main scenarios, MTS and MTO.
    In MTS, the general display filters are available in MD04.  Standard SAP filters do not filter on 'customer'.  I suspect this is because the concept would normally be illogical in a MTS environment.  Planned orders do not exist to serve a customer, but to serve 'stock'.  But let us not think about SAP and their logic.
    SAP allows you to create customized filters, in IMG>Production>MRP>Evaluation>Filter>Define Display filter.  Within this definition, under the  "Addnl Selections' tab, you can tick 'Define addl selections in the transaction'.  When you use this filter in MD04 display, then, one of the options available to you is to enter a specific Customer number, and then the display will only show the requirements from this customer.  Since you have excluded all other customer's orders, all orders of a single customer will be displayed consecutively.  Next to each other.
    In the case of MTO, the 'filter-by-customer' concept makes more sense (although, not for the reason you have stated.  You would have to find some manual method to convert a production order from supporting one sales order item, to supporting another sales order item.  Possible but difficult).  Anyway, the above mentioned customized filter would also work in an MTO environment.
    Regards,
    DB49

  • Can we share the same Business Action between clients?

    Hi All,
    I have a scenario wherein we have two Remote Trading Partners (say Remote1 and Remote2). Both these clients send EDI-850 documents and expect EDI-997.
    So,
    1. I first go to the Protocols Tab.
    2. Create a Business Action (Process_850) and Follow the Wizard for the details.
    In the process i create
    a. Process Protocol
    b. Document Protocol
    c. Exchange Protocol
    Now for the second client also sends us the EDI-850 document. So can I reuse all the above created objects and just have two Agreements one with Remote1 using the same Business Action (Process_850) but different Delivery Channels
    Or should i be creating different Business Actions for the different Clients?
    If i indeed have to create diff business actions then can i reuse the Document Protocol between clients? It does allow you to select and existing one.
    Finally, If i understand this correct, We create a Business Action and hence the Document Protocol. We set the default values of the Document Protocol Parameters in here and when we create Trading Partners we override these (Application Sender Code, etc.). In a way we are saying that Process_850 is a business action that is processing 850 documents. 850 being a template and the document parameters are the replacements done on 850 when it is sent by Sender we have say Acme and when it is receiver we have GlobalChips.

    If it is for two diffrent trading partner you can share the same business action.

  • I cannot connect my iPhone 4S to my home wifi. When trying to connect it says I have the wrong password, but I can connect my MacBook to the same network with the same password. I have tried to restart my router, reset my network settings, fail!

    Hello, I am having some major troubles connecting my iPhone 4S to my home wifi. When I try to connect on my phone, it says I have an incorrect password. That's not possible because I can connect my MacBook to the same network with the same password. I have reset my network settings on my phone, reset my router, called apple support, triple checked I was trying it in correctly, I have no clue what's going on.
    The only thing different is I just moved, but I have the same router/phone/internet provider.
    I've seen some discussions of router security options being the problem, I have my router connected to : WPA-PSK [TKIP] + WPA2-PSK [AES].
    The other options are: WEP , WPA-PSK[TKIP] , WPA2-PSK [AES] , WPA/WPA2 Enterprise.
    My troubleshooting and understanding of all this is pretty limited, my applecare service did not help, please can anyone help me?
    Thanks!

    If the issue happened after an update, you may want to go into an Apple Store. Be sure to let them know exactly what's wrong with the device.

  • Running XI and 6.5 Services on same Business Objects Server

    We are currently thinking about  migrating to Business Objects XI from 6.5 SP4.
    We are running with a 3-tier architecture, with the Business Objects services running on a Windows Server.
    Due to the number of users and reports in circulation we would like to do the migration in phases.
    Is it possible to run both the XI and 6.5 services on the same Business Objects server at the same time?

    That's actually a migration secanario so it should work fine. I had no trouble with 5.2 and 6.0 on the same system.
    Tom

  • Multiple Custom Synch Plugins For Same Business Object

    Can I make multiple plugins for the same business object? The main reason I'm asking is because I want to have one item plugin that runs before the core item data synchs and another item plugin that runs after.
    Since the topic's here, if multiple plugins can be written, which order would two plugins run if they are both set to go off after the core synch?

    That answers half of my question, although just to verify:
    The only issue is the before synch plugin may not have it's data in SBO (eg new order from webtools). If the data initiated in SBO then you should be fine.
    As far as I can tell, you're basically saying that if you're working with data in SBO in a plugin that's set to PluginExecutionLocation.BeforeSynch, be cautious of the fact that new data from Web Tools will not have the plugin run against it because it will arrive after the standard synch brings it over. I would assume the same would be true for the reverse, in that any new data in SBO that's not yet in Web Tools will also not have the plugins run against it for the same reason.
    Also, let's say I create two SynchPlugins for Items and set both of their SynchRunTime fields to PluginExecutionLocation.AfterSynch - which one runs first? Or is it indeterminable each time?

  • How to Identify the Same Characters in 2 Different Strings

    Hi All,
    I am requiring a suggestion on how to identify the same characters in 2 different Strings, for example:
    String str1 = "hello";
    String str2 = "llheo";
    Both Strings contain the same characters, but in a different order, so what would be the best technique to verify t that both Strings indeed contain the same characters?
    I was personally thinking along the lines of using the class, java.util.regex.Pattern?
    Any thoughts would me much appreciated. Thanks

    I would instead sort the characters, and then compare
    the sorted data.
    I'm fealing generous
        private static boolean anagram(String left, String right)
            if (left.length() != right.length())
                return false;
            char[] leftChars = left.toCharArray();
            char[] rightChars = right.toCharArray();
            Arrays.sort(leftChars);
            Arrays.sort(rightChars);
            return Arrays.equals(leftChars, rightChars);
        }

  • Can we use same Business Service for Sender and Receiver

    Can we use same Business Service for Sender and Receiver

    Hi
    In addition to the above infomation explaining about the Business Service..
    Business Service: Address an abstract business entity as the sender or receiver of messages.
    Using a business service, you can define the technical or business subunits of the companies involved and then assign them the relevant interfaces.
    The business services are used when configuring cross-company processes also..
    regards
    Kishore

  • How can i define the same business partner as Vendor and Customer and link between them

    Hello Professionals,
    I want to define the same business partner as customer and vendor and link between them,
    How can i do this in SAP B1?
    Thanks in Advance,

    Hi Karem
    Our Account People doing like this only in my company. 
    If you Raise A/R Invoice means customer list only show in Business Partner List.
    If you Raise A/P Invoice means Vendor list only show in Business Partner List
    We Follow different Code for Customer and Vendor as show below.
    for Vendor  = Code Starts with V0001
    for Customer = Code Starts With C0001
    With Regards
    Balaji

  • Querying last element in a dimension based on another level in the same dimension using MDX

    Summary: I need to write an MDX that returns the last date available in the level in the date dimension based for each month in the same dimension.
    Details: i have the a dimension which has the following levels. 
    Dim_Date :  Date (key) , Month (name of month), Quarter, Year.
    The query i m trying to come up with would return the result something like
    Month  || Max_date || measure1
    Jan         2014-01-25    100
    Feb        2014-02-28     200
    Please let me know if the above makes sense. Basically i m trying to get the max date for each month. 
    Thanks
    Sri

    Hi SrikanthGS,
    Assuming that with the last date available for the measure you mean the last date with non-empty figures, consider the following against the AW:
    SELECT [Measures].[Internet Sales Amount] ON 0,
    Generate (
    [Date].[Calendar].[Month].Members,
    ( Exists ( [Date].[Month of Year].[Month of Year], [Date].[Calendar].CurrentMember ),
    Tail (
    NonEmpty (
    Descendants ( [Date].[Calendar].CurrentMember, [Date].[Calendar].[Date] ),
    [Measures].[Internet Sales Amount]
    1
    ) ON 1
    FROM [Adventure Works]
    WHERE [Product].[Product Categories].[Subcategory].&[1]
    Philip,

  • Same Business system to two XI/PI landscapes and possibly two ESR's

    Hello,
    We are setting up a new PI 7 landscape in parallel to our current XI 3 landscape.
    We do not foresee a migration of XI to PI in the short run so the two systems, XI and PI will run next to each other.
    The problem we then have is with the ESR and proxies. The same business system must be able to connect to both XI and PI and must also be able to generate proxies with interface content from XI as well as with interface content from PI.
    The connection from business system to ESR repository seems to be 1:1, only one ESR per business system (defined via SXMB_ADM)
    Is there a way to allow ESR content from two XI/PI systems in one business system simultaneously?
    How do we solve this issue?
    Thanks
    Tom

    Hi Tom,
    as you already said its 1:1 connection between ESR and business system. The connection is taken from the exchangeProfile, refer to [ABAP Proxy Generation on SAP help|http://help.sap.com/saphelp_nw04/helpdata/en/14/555f3c482a7331e10000000a114084/content.htm].
    I suggest you to create the interfaces in XI, generate the proxies and transport to PI.
    How are you going to use the to integration servers for ABAP proxy scenarios? I am asking because you only can use one integration server at a time for outbound ABAP proxies in SAP standard. You define the URL or RFC destination to the corresponding integration server in SXMB_ADMIN.
    Regards, Martin

  • Dynamic Interface Determination Using the same Business System

    Folks...
    Does anyone have any good ideas on how to build a scenario where the same business system is used, but the interface mapping needs to be dynamic? I have a single JMS sender and 40 different message types on one side, and 40 ABAP Proxies on the other. The two solutions I see are as follows:
    1. Create 40 separate JMS Senders with 40 different sender agreements
    2. Create 40 Business Services for the same ECC system and utilize XPath expressions to support conditionally selecting an interface mapping
    Neither of these in my mind is a great solution, does anyone have any others?
    Mahalo,
    Jonathan

    Hi, I came cross the same problem on my current project, now I have following solution:
    Create a number of JMS sender adapters, they all connect to same queue, but each JMS sender adapter only pick up particular type of message based on one JMS message property value. The message provider will be responsible to set the property value when they send message into the queue.
    In JMS sender adapter, Parameter Tab -> Advanced Tab ->check Set Adapter-Specific message Attributes ->check Specify Additional JMS Message Properties (Maxmum of 10) -> Add Property name, e.g. "MsgType"
    ->Processing Tab -> Input Value in "JMS Message Selector", e.g. MsgType='WorkOrder'
    after above setup, this adapter will only pick up messages that with "MsgType" Property value "WorkOrder"
    For each type of adapter, you will create a JMS sender adapter and repeat the steps above, just put on the different Property value.
    This approach will have number of Integration Scenarios, hence will have number of Sender Agreement.
    I have tested the approach and it works.
    Liang

  • Import ID Configuration Scenarios and keep the same Business System names

    Hi Guys,
    Is it possible to transport ID Configuration Scenarios Objects between 2 XI systems and keep the same names for both sender and receiver Business Systems ? That is, to skip the SLD lookup for transport Source and Transport Targets systems ?
    I tried to create the same Business Systems under the same name twice, but this was not possible. Any ideas ?
    The reason is that I want to transport all the objects from one XI DEV server to another XI DEV server.
    Thank you,
    Best Regards,
    Evaggelos Gkatzios

    Hi,
    We have done same but with bit of manual work (without Transport).
    Create SLD object in target system with same name as in Souce XI system SLD.
    IR & ID was exported using TPZ files from Source system & were imported in Target system.
    It used same object names in both XI systems.
    Regards
    Sushil

Maybe you are looking for

  • Ranger 3D

    Hi! Is there anyone else who has already developed application to Ranger 3D (used Ranger Toolkit for Labview?) +++ In God we believe, in Trance we Trust +++ [Hungary] Solved! Go to Solution.

  • I tunes is locked

    Hey I totally need help. My daughter named her nano "Phoebe" and when I tired to charge it i tunes came up with a lock symbol on the bottom where it says how much time is left. I cant play any music under "phoebe" playlist but can play any other play

  • Timestamp in Run PL/SQL

    Hello everyone, Oracle 11gR2 SQL Developer 3.2.09 We have a stored procedure in a package that returns a refcursor. One of the columns (say XYZ) is timestamp with local time zone. When I right click on the package and select Run I get the Run PL/SQL

  • How do i "delete right" on my ipad 2?

    Is there a way to delete right on my ipad 2. If not on the ipad itself, is there a way to do it if i attach my Logitech case for Ipad 2? Clicking "control D" on the Logitech keyboard doesnt work and there are no function or command keys on the glass

  • Photoshop documents not opening

    So I use Photoshop a lot. I think I got CS6.Anyways. Last week I could play 3 internet files, two movies, photoshop 5 different documents and much more. However, now I can't open internet and do photoshop. I have to restart my computer to run photosh