Key lookup in Routine

Hi all,
With a routine on my Customer InfoObject I want to write from two DSO's to an InfoCube. One DSO contains Sales data and the other Customer data. In case of a matching key in mentioned DSO's customer data must be written to the InfoCube. So therefor i need to do a customer lookup. This key contains ZRBDOCNR and ZRBPOSNR. Customer InfoObject = ZRBCUS. My question is: "how do i realize this in ABAP code?"
Thanks in advance!

Hi,
here coustomer information can be looked up when the Key combination is matched.
before updating data into Cube, first both data needs to be taken into Intenal table od Cube Start routine and Combine the data in another internal Table,
this internal table data is taken as a check for updating into Cube.
hope this Helps
Regards
Daya Sagar

Similar Messages

  • KEY LOOKUP Operator using TCL

    Hi,
    I am trying to create a key lookup operator using tcl.
    OMBALTER MAPPING 'TESTMAP' ADD KEY_LOOKUP OPERATOR 'INSTITUTION_CHARACTERISTIC_DIM'\
    SET PROPERTIES (BOUND_NAME,CREATE_NO_MATCH_ROW, LOOKUP_CONDITION)VALUES
    ('INSTITUTION_CHARACTERISTIC_DIM','true','OUTGRP1.INSTITUTION_CHAR_SRCKEY
    = INGRP1.INST_CHAR_SRCKEY')
    and then adding an attribute to the INGRP
    OMBALTER MAPPING 'TESTMAP'ADD ATTRIBUTE 'LAST_ACTIVITY_DATE' OF GROUP 'INGRP1' OF OPERATOR 'INSTITUTION_CHARACTERISTIC_DIM'
    This is creating a key lookup operator by the name
    INSTITUTION_CHARACTERISTIC_DIM, and i can see the Bound Name in the
    properties window, but when i double click and open the key lookup, i
    dont see the result table under the LOOK UP tab.Because of this, the
    attributes dont get added in the OUTGRP of the key lookup.
    Am i missing some important property of a key look up?
    can some one please help me with this...
    Thanks in advance...

    Hi,
    you have to bind the lookup operator to the table:
    OMBALTER MAPPING 'MAP_LOOKUP' ADD KEY_LOOKUP OPERATOR 'MY_LOOKUP' BOUND TO TABLE '/MY_PROJECT/MY_DB/DIM_CUSTOMERS'
    OMBALTER MAPPING 'MAP_LOOKUP' MODIFY OPERATOR 'MY_LOOKUP' SET PROPERTIES (CREATE_NO_MATCH_ROW, LOOKUP_CONDITION)VALUES ('true','OUTGRP1.ID_CUSTOMER=INGRP1.ID_CUSTOMER')
    OMBALTER MAPPING 'MAP_LOOKUP' ADD ATTRIBUTE 'ID_CUSTOMER' OF GROUP 'INGRP1' OF OPERATOR 'MY_LOOKUP'Regards,
    Carsten.

  • How to add new key lookup in Mapping ?

    Hi,
    I am learning OWB 10g from oracle.com site. I am following the Oracle-By-Example.
    [http://www.oracle.com/technology/obe/obe_bi/Lesson6_Designing_ETL_Data_Flow_Mappings/designing_etl_data_flow_mappings.htm]
    My OWB version is:
    OWB Client     : 10.2.0.1.31
    OWB Repository      : 10.2.0.1.0
    But the screenshots are different than what I am getting on my OWB. Am I using the correct version of Oracle-By-Example?
    I have created Mapping Dimension and Mapping Table. Now i want to add a Mapping Key Lookup. But as the screenshots shown in Oracle-By-Example are different, I cannot go further.
    Please help me.
    Thanks!
    Yogini

    Hi Yogini
    Here are some steps, it should be fairly straightforward, you can view the online help for more information.
    1. Drag and drop the Key Lookup operator on to the Mapping Editor.
    2. The Lookup wizard opens on the Welcome page. Select Next to move to page 2.
    3. Provide a name and description for the operator, default is KEY_LOOKUP. Hit Next to move to page 3.
    4. On the Groups page, hit Next.
    5. Select attributes to use in key lookup. For example those from the WAREHOUSES table in the OBE you are using that you will lookup in the COUNTRIES table. Shuttle those attrbutes to the right hand side. Hit Next to move to page 4.
    6. Select the COUNTRIES table from the combo box nder 'Select the object which has the lookup result. In the lookup conditions table ensure the matching criteria is set ie . LOCATION_ID from WAREHOUSE matches with LOCATION_ID from COUNTRIES. Hit Next to move to page 5.
    7. Here you can define the strategy for matches, just hit Next, then Finish. You have walked through all pages and are complete.
    Cheers
    David

  • Is there a limit on the number of Key Lookups against a table in a mapping

    I'm using OWB 11.1 and have a mapping with 15 Key Lookups against the one table. When I Validate the mapping it objects to a Key Lookup not being connected, even thuogh in the mapping all the Key Lookups have been renamed to their relevant fields?
    Is there a limit to the number of key lookups against the one table?

    Thanks for the replys.
    I'm getting a validation error, so can't run the mapping. Error VLD-1108: Operator Key_LOOKUP is not properly connected.
    The issue is solved, after checking each of the Key_Lookups, one was not connected to an output. The error occurs if an output field isn't used (connected to) a table or other operator.
    Edited by: user616385 on Sep 30, 2009 7:58 PM
    Edited by: user616385 on Sep 30, 2009 8:01 PM

  • Key-lookup on SCD II does not generate complete outer join

    Using OWB 10.2.0.3
    In a mapping to populate a fact table, I have to join two source tables (inner join). After that I have to perform a number of lookups on dimension objects to retrieve the dimension keys I want to store in my fact table. These dimensions are all SCD type II. All lookups are performed on the detail level of each dimension.
    In the generated code, the join condition is an outer join. However, the condition that OWB generates to determine the correct level of the dimension is an inner join:
    SELECT
    FROM
    "TMI_CELLEN_ACT" "TMI_CELLEN_ACT",
    "DIM_TMI_BESTEMMINGEN" "KL_DIM_TMI_BESTEMMINGEN"
    WHERE
    ( "KL_DIM_TMI_BESTEMMINGEN"."BEST_CODE" (+) = "TMI_CELLEN_ACT"."BESTEMMINGSCODE" ) AND
    ( ( "KL_DIM_TMI_BESTEMMINGEN"."BEST_ID" IS NULL ) OR
    ( "KL_DIM_TMI_BESTEMMINGEN"."BEST_ID" = "KL_DIM_TMI_BESTEMMINGEN"."DIMENSION_KEY" ) ) AND
    ( ( "KL_DIM_TMI_BESTEMMINGEN"."EFFECTIVE_DATE" IS NULL ) OR
    ( ( "KL_DIM_TMI_BESTEMMINGEN"."EXPIRATION_DATE" IS NOT NULL ) AND
    ( TO_DATE ( trunc(sysdate) ) >= "KL_DIM_TMI_BESTEMMINGEN"."EFFECTIVE_DATE" ) AND
    ( TO_DATE ( trunc(sysdate) ) <= "KL_DIM_TMI_BESTEMMINGEN"."EXPIRATION_DATE" ) ) OR
    ( ( "KL_DIM_TMI_BESTEMMINGEN"."EXPIRATION_DATE" IS NULL ) AND
    ( TO_DATE ( trunc(sysdate) ) >= "KL_DIM_TMI_BESTEMMINGEN"."EFFECTIVE_DATE" ) ) )
    In my case, this results in an empty data set.
    When using ANSI sql, the 'level-conditions' are generated as a WHERE-clause, which also results in an empty data set. When this code is included in the LEFT OUTER JOIN clause, all my data is there.
    What is going on here?
    Thanks
    Paul

    The "clever" workaround is to use a joiner, which is the way we implement the key lookup. So simply use that.
    To just explain why we limit the key-lookup. The main reason is that this operator is cardinality neutral. That means we always expect it to return one and only one row. If we give you too much flexibility we increase the risk of getting more than one row back which would break the logic for the mapping.
    Hope this makes sense, but just go with the joiner.
    Thanks,
    Jean-Pierre

  • Multiple key lookups to the same dimension

    I have a fact table that has columns old_item and new_item. These are both foreign keys to the items dimension.
    The source has old and new item codes. Therefore I want to do two key lookups to the item dimension.
    Using the key lookup function the generated code combines the two lookups into one thus giving the wrong result. That is the lookup become like shown below,
    INSERT INTO "FT1"
    "L1_ID",
    "L1_ID1"
    SELECT "DT1"."L1_ID" "L1_ID",
    "DT1"."L1_ID" "L1_ID$0"
    FROM "ST1" "ST1",
    "DT1" "DT1"
    WHERE ("DT1"."L1_ID" (+) = "ST1"."C1")
    AND ("DT1"."L1_ID" (+) = "ST1"."C2")
    Does anyone know how to get WB to produce the correct code?
    I can create my own transforms to do this but can it be done using the key lookup function?
    Thanks

    Jean-Pierre,
    I think Jeffrey didas you adviced. The problem is that even when you are using two different key lookup objects referencing the same table, the table is used only once in the select-statement, but with both conditions, instead of selecting the table twice, each with its own alias and conditions.
    Matbe that you can tell us which version does generate the correct code. I have have tested it again with OWB 9.0.3.35.1 (the latest version I believe), and still ran into this and many other problems.
    If you don't want to use a transformation, my advice would be not to use the key lookup object at all, but stick to the joiner object to join the lookup tables with the source table(s). The "drawback" is that you have to write the extra conditions yourself.
    Greetings,
    Rob Nijland

  • LookUP in Routine

    Hi,
    I need to create a Lookup for some fields coming from 2 different PSA table (/BIC/B000........) in start routine.
    I'm not good in ABAP, Please some one help me to write the codes.
    Thanks,
    Pria

    This is the SELECT statement in the code that you have written:
    SELECT WBS_ELEMT APPR_YEAR PROG_DEF_S PROG_POS /BIC/ZAPP_REQ FROM
    /BIC/AZASIPROJ00
    INTO TABLE I_S_ZASIPROJ
    ---> (INTO CORRESPONDING FIELDS OF TABLE I_S_ZASIPROJ can also be used, make sure your field names are proper)
    for all entries in the source_package
    where
    WBS_ELEMT = SOURCE_FIELDS-WBS_ELEMT
    APPR_YEAR = SOURCE_FIELDS-FISCYEAR.
    IF SY-SUBRC EQ 0.
    SORT I_S_ZASIPROJ BY WBS_ELEMT.
    ENDIF.
    *And on the field side*
    (Should consider taking off this loop, as said earlier)
    LOOP AT I_S_ZASIPROJ INTO WA_I_S_ZASIPROJ.
    READ TABLE I_S_ZASIPROJ INTO WA_I_S_ZASIPROJ WITH KEY
    WBS_ELEMT = SOURCE_FIELDS-WBS_ELEMT
    APPR_YEAR = SOURCE_FIELDS-FISCYEAR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    RESULT = WA_I_S_ZASIPROJ-PROG_POS.
    ENDIF.
    ENDLOOP.
    You said that you have multiple records with the Key:
    WBS_ELEMT = SOURCE_FIELDS-WBS_ELEMT
    APPR_YEAR = SOURCE_FIELDS-FISCYEAR
    If so, how will you get the different records? Because i think WBS_ELEMENT & APPR_YEAR will remain the same.
    Do you have any other field that can be compared? If so, this will save the effort of the Loop in the Field side.
    *Just use:*
    READ TABLE I_S_ZASIPROJ INTO WA_I_S_ZASIPROJ WITH KEY
    WBS_ELEMT = SOURCE_FIELDS-WBS_ELEMT
    APPR_YEAR = SOURCE_FIELDS-FISCYEAR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    RESULT = WA_I_S_ZASIPROJ-PROG_POS.
    ENDIF.
    One more thing you can try is using Field-Symbols. You can have dynamic memory allocation.
    Syntax:
    Field-Symbols: <WA_I_S_ZASIPROJ> TYPE I_S_ZASIPROJ.
    (Instead of DATA: WA_I_S_ZASIPROJ TYPE I_S_ZASIPROJ.
    (Only change in the Read Statement)
    RESULT = <WA_I_S_ZASIPROJ>-PROG_POS.
    You need not use the CLEAR statement for the Field-Symbol.
    As said earlier, the code works fine & is faster in the Dev system. What is the number of records that we are looking at?
    I guess, as your count in Test system is ~ 2 mils, it is taking some more time than in Dev.
    Doing away with the loop should help you.
    Now, coming to the Message part.
    Go to SE91 -> Create a Message Class -> Assign a package ($TMP for time being) ->
    Select the Message Number (000 to 999, any) -> Maintain Selected Entries (Pencil symbol) ->
    Message Short Text: WBS Element & less than 50%  (Here '&' is a place holder) -> Save
    In the Transformation -> Use the table rsmonitor (this is already defined in the Start Routine or field routine)
    READ TABLE I_S_ZASIPROJ INTO WA_I_S_ZASIPROJ WITH KEY
    WBS_ELEMT = SOURCE_FIELDS-WBS_ELEMT
    APPR_YEAR = SOURCE_FIELDS-FISCYEAR
    BINARY SEARCH.
    IF SY-SUBRC EQ 0.
    RESULT = WA_I_S_ZASIPROJ-PROG_POS.
    ELSE.
    MONITOR_REC-MSGID = 'ZMESSAGE'.
    MONITOR_REC-MSGTY = E/ I /S /W  (E- Error, I - information, W -Warning.)
    MONITOR_REC-MSGNO = '001'.
    MONITOR_REC-MSGV1 = 'SOURCE_FIELDS-WBS_ELEMT'.
    APPEND MONITOR_REC TO MONITOR.
    * RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
    ENDIF.
    It display in monitor screen as
    ZMESSAGE W 'WBS Element (WBS_ELEMENT Number) less than 50%' .
    May not be the exact code. So, just play around & check the syntax.
    Please check: Creating monitor entries

  • Value of Function Key in Requirement Routine

    Hi All,
    I have a requirement where in for transaction VF04, whenever the user clicks on the button collective billing document or collective billing doc/online, a certain piece of code needs to be executed in a requirement routine. How can i capture the values of these function keys in the requirement routine.
    Regards,
    Jayant

    I am not sure if this helps you.. but Table RSMPTEXTS will store all the menu path / function codes of a program.

  • Lookup routine problem

    Hi
        I have problem in Lookup routine in transformation.
    But need for some object which were not in Standard infocube 0sd_c03, i have created one customize Infocube ZSD_C03_1 where data have been coming from Standard 0SD_C03 infocube by Lookup Transformation routine & running full load DTP in Daily basis. It is working fn till today.
    But problem is that now size of data is very huge while full DTP run from 0sd_c03 to ZSD_C03_1. can any one give suggestion what should i do for only delta data come. lookup routine should update data in daily.plz help

    Hi
    In that case i would suggest you to have a DSO between the data loding process as your expectation cannot be met with data
    loading between cube to cube.
    Just create a standard DSo between the cubes and do the data loading so that the delta handling will be as per your
    expectation
    Prathish

  • Problem with unique key for Fiscal_T_Time dimension lookup

    Hi,
    In my mapping, I use Lookup on Fiscal_T_Time dimension provided by oracle. The validation gives me a warning,saying "VLD-1603:Lookup condition for key lookup Fiscal_T_Time does not contain a complete unique key". I'm using <source_group>.date as input and L_Day_day as lookup column, which is shown as I select the unique key from the drop down list. Both have type matches. The configuration on the dimension also shows the constraint of the unique Key. What can be wrong?

    Continue my issue in another thread by Daming Wang on "More constraints need to add to Dimension". Thanks.

  • Poplulate key figure thru the start routine

    Hi Experts,
    I have update rules for my cube. In the start routine there, if i wrote abap code would it automatically fill the value of key figures in the cube. Can we do that with the ABAP code ?
    Or do i have to go to each key figure's routine and then refer to the internal table data in the update rules etc.
    If someone has done this before, would you pls walk me thru it.
    Thank you,
    T

    Hi Tia Ismail,
    I hope it is wrong to update the cube fields directly in the start routine.
    i,e
    <i>add DATA_PACKAGE-/bic/zslsgm to /bic/ft_mismets-/bic/Zslsgm.
    add DATA_PACKAGE-/bic/zsalesamt to /bic/ft_mismets-/bic/Zsalesamt.
    add DATA_PACKAGE-/bic/zinvlines to /bic/ft_mismets-/bic/zinvlines.</i>
    The above statements are wrong.
    Then start routing you will update the values (from blank to some value) for these fields. And also make 1 to 1 mapping Between these KF of info cube to Fields of Communication structure. i,e
    Zslsgm(Info cube KF) <---> Zslsgm(Communication structure field)
    Zsalesamt(Info cube KF) <---> Zsalesamt(Communication structure field)
    zinvlines (Info cube KF) <---> zinvlines(Communication
    structure field)
    The code you have to use in Start routine is :
    tables: /bic/pzproduct,
    /bic/ft_mismets.
    DATA ITAB like /bic/pZproduct occurs 0 with header line.
    select * from /bic/pzproduct into table itab where /bic/zproductlike 'misc%' and /bic/t_miscper is not null.
    Loop at DATA_PACKAGE.
    Loop at itab where
    /bic/zproduct <> DATA_PACKAGE-/bic/zproduct.
    DATA_PACKAGE-/bic/zslsgm = 0.
    DATA_PACKAGE--/bic/zinvlines = 0.
    DATA_PACKAGE-/bic/zsalesamt  = 0.
    Modify DATA_PACKAGE.
    endloop.
    ENDLOOP.
    With rgds,
    Anil Kumar Sharma .P
    Message was edited by: Anil Kumar Sharma

  • Which is the difference between a join and a lookup key

    Hello everybody,
    I want to know in which case we must use a join or a lookup key.
    How OWB translate this two orders ?
    If you want more information, ask me.
    Best regards,
    Chris

    Hi,
    In a normal mapping, you can use a Key Lookup operator or a joiner. The Key Lookup operator operates as an outer join. You can use a joiner instead of a Key Lookup operator with the join condition specified with outer joins.
    In my view, use joiner with the lookup condition specified in outer join. Using keu lookups, in a complicated mapping can lead to the following error at runtime:
    "A table can be outer joined with atmost one other table".
    Apart from this, I think Key Lookups are generally useful in dimension lookups in a datawarehouse, where you can specify the level where you should search for a match. The 10g R2 user's guide provides the details on how to do this.
    Regards
    -AP

  • IN BW how many  routines are there  in 3.5 and which scenario used

    Hi expert,
      i am pradeep. a job seeker . could please send me doc of routines in bw 3.5
    and i will be give good point my  id [email protected]
    regards
    pradeep

    Hi Pradeep
    transfer routine: When you want to write a routine at field level in transfer rule.
    Date key figure: Convert DATS format to DEC format
    Date Conversion in Flat File
    Transfer Routine ABAP
    conversion exit
    Date Conversion
    Problem with  conversion char to numc in transference rules
    conversion routine..?
    start routine in transfer rules: When you want to write a logic which is applicable on whole data package comming from data source
    Look up to load master data
    excluding
    Start Routine in Transfer Rules
    Sample code in Update Rule to restrict data selection?
    Append Datapak - transfer start routine
    Excluding Blank field in Infopackage Filter
    Trans Routine ABAP help ..
    update routine: Its data target specific, when you want to update any field in target by some mapping like 1:1,master data lookup,constant,routine
    How to call a function in Update Rules to reverse a key figure sign
    Need Sample Code for Update Rules
    Date calculation
    Difference between data in PSA and Data in Infocube
    No RETURNCODE <> 0 allowed in update routines in transfer mode
    the diffrerece between DEC and (yyyymmdd) 8 char in Time defination
    Access master data in update rules
    Date key figure: Convert DATS format to DEC format
    start routine in update rules: same as transfer routine...when you want to apply logic on data package available in infosource
    Is it possible to read a third ODS in update rules between two ODS?
    update rule coding while loading data from ODS to CUBE
    Start Routine in Update Rules to populate additional fields from ODS
    Coding in Update Rules accessing a Z-Table
    Start routine
    Thanks
    Tripple k

  • Using a byte[] as a secondary index's key within the Collection's API

    I am using JE 4.1.7 and its Collections API. Overall I am very satisfied with the ease of using JE within our applications. (I need to know more about maintenance, however!) My problem is that I wanted a secondary index with a byte[] key. The key contains the 16 bytes of an MD5 hash. However, while the code compiles without error when it runs JE tell me
    Exception in thread "main" java.lang.IllegalArgumentException: ONE_TO_ONE and MANY_TO_ONE keys must not have an array or Collection type: example.MyRecord.hash
    See test code below. I read the docs again and found that the only "complex" formats that are acceptable are String and BigInteger. For now I am using String instead of byte[] but I would much rather use the smaller byte[]. Is it possible to trick JE into using the byte[]? (Which we know it is using internally.)
    -- Andrew
    package example;
    import com.sleepycat.je.Environment;
    import com.sleepycat.je.EnvironmentConfig;
    import com.sleepycat.persist.EntityStore;
    import com.sleepycat.persist.PrimaryIndex;
    import com.sleepycat.persist.SecondaryIndex;
    import com.sleepycat.persist.StoreConfig;
    import com.sleepycat.persist.model.Entity;
    import com.sleepycat.persist.model.PrimaryKey;
    import com.sleepycat.persist.model.Relationship;
    import com.sleepycat.persist.model.SecondaryKey;
    import java.io.File;
    @Entity
    public class MyRecord {
    @PrimaryKey
    private long id;
    @SecondaryKey(relate = Relationship.ONE_TO_ONE, name = "byHash")
    private byte[] hash;
    public static MyRecord create(long id, byte[] hash) {
    MyRecord r = new MyRecord();
    r.id = id;
    r.hash = hash;
    return r;
    public long getId() {
    return id;
    public byte[] getHash() {
    return hash;
    public static void main( String[] args ) throws Exception {
    File directory = new File( args[0] );
    EnvironmentConfig environmentConfig = new EnvironmentConfig();
    environmentConfig.setTransactional(false);
    environmentConfig.setAllowCreate(true);
    environmentConfig.setReadOnly(false);
    StoreConfig storeConfig = new StoreConfig();
    storeConfig.setTransactional(false);
    storeConfig.setAllowCreate(true);
    storeConfig.setReadOnly(false);
    Environment environment = new Environment(directory, environmentConfig);
    EntityStore myRecordEntityStore = new EntityStore(environment, "my-record", storeConfig);
    PrimaryIndex<Long, MyRecord> idToMyRecordIndex = myRecordEntityStore.getPrimaryIndex(Long.class, MyRecord.class);
    SecondaryIndex<byte[], Long, MyRecord> hashToMyRecordIndex = myRecordEntityStore.getSecondaryIndex(idToMyRecordIndex, byte[].class, "byHash");
    // END

    We have highly variable length data that we wish to use as keys. To avoid massive index sizes and slow key lookup we are using MD5 hashes (or something more collision resistant should we need it). (Note that I am making assumptions about key size and its relation to index size that may well inaccurate.)Thanks for explaining, that makes sense.
    It would be the whole field. (I did consider using my own key data design using the @Persistent and @KeyField annotations to place the MD5 hash into two longs. I abandoned that effort because I assumed (again) that lookup with a custom key design would slower than the built-in String key implementation.)A composite key class with several long or int fields will not be slower than a single String field, and will probably result in a smaller key since the UTF-8 encoding is avoided. Since the byte array is fixed size (I didn't realize that earlier), this is the best approach.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • SCD Map Lookup Max(dim_key)

    I have one scd 2 dimension STORES_DIM that works properly and the solved dim has 6 rows of each STORE_NAME for each hierarchy level and adds a corresponding unique dim key. Good
    I have another mapping to load another cube. I added a Key Lookup to grab the dimension key from the STORES_DIM based on the STORE_ID (input). Then inserts that key with the data into a cube. Although the STORES_DIM is built as scd 2, for this cube load I only need 1 row for each STORE_ID.
    The problem: The mapping key lookup grabs all 6 dimension keys for just 1 STORE_ID and loads 6 rows into the target cube when I only need 1 row inserted.
    The question:
    How to handle this so the lookup only grabs the last dim key for each STORE_ID. In sql I would do a "select max(dimension_key) from STORES_DIM where STORE_ID = SOURCE_STORE_ID". Or is there another operator to use for this instead of key lookup?
    Thanks for the assistance!!

    Hello RMomaha,
    let your key lookup point to the dimension STORES_DIM (lookup-tab) and select "Use the most current record" (Type2 History Lookup-tab). This option returns the current record that corresponds to the attribute being looked up using the lookup condition. The current record is the one with the latest timestamp.
    Regards
    jwehner

Maybe you are looking for