Best approach to delete records that are not in the source table anymore.

I have a situation where I need to remove records from dimensions that are not in the source data anymore. Right now we are not maintaing history, i.e. not using SCD but planning for the next release. If we did that it would be easy to figure the latest records. The load is nightly and records are updated and new added.
The approach that I am considering is to join the dimension tables the the sources on keys and delete what doesn't join. However, is there perhaps some function in OWB that would allow to do this automatically on import so it can be also in place for the future?
Thanks!

Bear in mind that deleting dimension records becomes problematic if you have facts attached to them. Just because this record is no longer in the active set doesn't mean that it wasn't used historically, and so have foreign key constraints on it in your database. IF this is the case, a short-term solution would be to add an expiry_date field to the dimension and update the load to set this value when the record disappears rather than to delete it.
And to do that, use the target dimension as a source table, outer join it to the actual source table on the natural key, and so your update will set expiry_date=nvl(expiry_date,sysdate) to set to sysdate if this record has not already been expired on all records where the outer join fails.
Further consideration: what do you do if the record is re-inserted into the source table? create a new dimension key? Or remove the expiry date?
But I will say that I am not a fan of deleting records in most circumstances. What do you do if you discover a calculation error and need to fix that and republish historical cubes? Without the historical data, you lose the ability to do things like that.

Similar Messages

  • Best way to obtain records that are NOT in another table

    I have two rather large tables in oracle. An Account table that has millions of rows. Each account may be enrolled into a particular program and therefore can also be in an Enrollment table, also with millions of rows. I'm trying to find the most optimal way to find any accounts in ACCOUNT that are NOT in the Enrollment table.
    I was doing something like this:
    select /*+ index(ACCOUNT idx_acct_no) */
    a.acct_no
    from ACCOUNT a
    where a.acct_no not in (Select e.acct_no from ENROLLMENT e);
    This takes a VERY long time to execute, even though I am using the index.
    I even tried to use the PK on the ACCOUNT table, as it is also a FK on the ENROLLMENT table as such:
    select a.acct_no
    from ACCOUNT a
    where a.id not in (Select e.id from ENROLLMENT e);
    this too takes too long to get back (if at all).
    Is there a better way to do this selection please?

    Well if you have the energy to type in the whole list, the syntax you've given will work, unless you blow the permitted number of elements.
    But a practical solution would be to turn the list into a table. You still haven't got the hang of this "giving us enough information" concept, so let's presume:
    (1) you're on a version of the databasse whoch is 9i or higher
    (2) you have this list in a file of some sort.
    In which case use an external table or perhaps a pipelined function to generate output which can be used in a SQL statement.
    If neither of these solutions works for you please provide sufficient information for us to answer your question correctly. Your future co-operation is appreciated.
    cheers, APC

  • Deleting applications that are not in the application folder

    I recently downloaded an app called Liteswitch. I didn't want it so I ctrl clicked on its icon in the System Preferences and removed the Liteswitch prefpane. But the app is still installed and working - how do I get rid of it?
    Thanks

    It's not only the Liteswitch app. It's more in general. I can't figure out if the apps are deleted when you ctrl click on their icon in the system prefs and remove it. The app still works after you have done this so it seems that it doesn't delete it. However after logging out the app doesn't work after logging back in, so maybe OSX waits to delete the app till you log out?

  • Deleting photos that are not in the Camera Roll.

    I just got a new ipod touch and I put photos from my PC onto my ipod and now I want to delete these photos but they are not in my camera roll and there is no delete button available. Please help me delete them!

    You delete them the same way you put them there.  The sync process.
    Deselect them in itunes and sync.

  • Is it possible to copy free apps that are not on the App Store anymore to multiple iPhones through iTunes sync?

    I have an old app on my iPhone that is able to run on ios7 but has now been deleted from the app store. I was wondering if iTunes sync would allow me to put it onto multiple iPhones with no problems - The iPhones that I want to copy it to are all the same (iPhone 5s), the app is on an iPhone 5s 16GB and I want to put it on an iPhone 5s 32GB.
    Thanks Tyler.

    Thank you.  Your reply is very helpful.
    I've never chosen to delete unused apps in my library because I was worried that if, in the future, one was of interest, that I'd have to re-purchase... so this is not the case then, right?  (I'd felt secure knowing that an app was stored on my computer... More than once, I've had to revert to backups and was glad to have copies of my apps safely stored away.) 
    I've been slow to adopt anything "cloud" so am not well versed on the benefits of using it.  So, just to be clear, if I delete an unused app in my local iTunes library, it will forever remain available in the cloud linked to my account, right?

  • How do you delete songs on iTune that are NOT on the library?

    I got a new computer few days ago, and I downloaded iTune on my new computer today.
    I want to delete all my songs that are in my iPod Touch now, and want to buy other songs.
    I don't have any songs in my library at the moment, since there's no song in my new computer now.
    So I want to delete songs, but since I don't have any of those songs in the library, I can't delete them. (I can't delete them since they are not on the library.)
    Are there any ways I can delete songs that are NOT on the library?

    You don't want to keep the songs that are on your iPod touch, in your library?
    You can keep them in your library and not put them on the touch.
    Then you can purchase other songs and put those on the touch.

  • TS3899 My ipad does not communicate with iphone on one of my email accounts and will not remove deleted emails that are done on the iphone and vice versa, what setting should be changed?

    My ipad does not communicate with my iphone on one of my email accounts and will not remove deleted emails that are done on the iphone and vice versa, what setting needs to be changed?

    It's my understanding that an iPhone can only sync with one computer. You need to choose one computer. Sounds like it syncs at work, but not at home. If you want to just sync it at home, then you have to make sure the home computer has all the info that you want on it, like music etc. Then you have to deauthorize the work computer for it to sync at home. When you connect it will ask if you want to set up as a new iPhone or restore from backup. If you don't have a backup on the home computer then either way you will be wiped clean. So any photos, contacts, notes etc you have will be erased. You would need to backup or copy your photos from your iPhone. When you connect it to your home computer, it will give you that popup message to open your iPhone files. Then you can copy those photos and save them onto your computer and sync them back in through iTunes.
    For your contacts, do you use any type of address book? If so you'll want to back that up and then transfer to your home computer. For notes, you can just email those to yourself and then save that email. I use MobileMe so the contacts issue is easily resolved.

  • Omit notes during MIDI recording that are not in defined scale

    I'm looking for a way to do the following in Logic, but am not sure how to set this up. I want to be able to:
    1. Create a new midi track
    2. In selected midi track, select a scale (for example, Pentatonic Minor)
    3. Press record
    4. During recording, only notes played from Pentatonic Minor scale would "register" (make a sound) and be recorded. All other notes pressed on midi controller that are not in Pentatonic Minor would not "register" nor be recorded in the sequencer.
    Additionally helpful would be that in the piano roll sequencer after recording, I could only drag notes up or down along the Pentatonic Minor scale. In other words, I would not be allowed to drag a recorded note to another note that is not in Pentatonic Minor. If a note was dragged onto a "disabled" note, it would automatically snap to its nearest neighbor note in the Pentatonic Minor scale. Additionally useful would be to have all disabled notes (notes that are not in the Pentatonic Minor scale) appear to be disabled (grayed out) in the piano roll sequencer.
    If this is not possible, is there any feature in Logic that will get me close to doing what I want? If not, is there any other sequencer that does this? I know this is something I could probably do in Max, but I was hoping to be able to do it in Logic. Thanks.

    Patch this between the PhysicalIn and the SequencerIn in the Environment:
    !http://home.arcor.de/fuzzfilth/Other/mod.png!
    Get it here:
    http://home.arcor.de/fuzzfilth/Other/Modulator.zip
    Christian

  • When I open mac mail, it opens 1000 emails in separate windows. Emails that are not even in my account anymore. Can anyone help?

    When I open mac mail, it opens 1000 emails in separate windows. Emails that are not even in my account anymore. The system freezes and the only thing I can do is force quit. Can anyone help?

    You should post in the Mail forum area of whichever os is installed on your computer.

  • Can I recover a deleted email that is not in the Trash?

    Can I recover a deleted email that is not in the Trash?

    If you have a recent backup yes. Or, possibly, if you do not use your computer at all (so the hard drive is not written on) and get some recovery software or company to try to see if the file is retrievable (not cheap). Other than that, unfortunately not.

  • Sharepoint Mp 2013 Discovers Servers that are not in the config file.

    Hi,
    Sharepoint Mp 2013 Discovers Servers that are not in the config file. Any workaround/fix?
    Regards,
    Mirza

    Hi,
    Would you please give more details about your question?
    Have you downloaded and imported the sharepoint 2013 management pack to your management group:
    System Center Management Pack for SharePoint Server 2013
    http://www.microsoft.com/en-hk/download/details.aspx?id=35590
    In addition, please also follow the below article to configure your management pack:
    Configuring the SharePoint 2013 Management Packhttp://blogs.technet.com/b/kevinholman/archive/2013/05/14/configuring-the-sharepoint-2013-management-pack.aspx
    It is also suggested to read the management pack guide before using the management pack.
    Regards, Yan Li

  • Infopath Form error - validation errors that are not in the current view?

    Hey Experts,
    I have a Sharepoint 2010 server running on Server 2008. We have a list that has a custom form created using infopath for editing and new creations.
    The problem appeared after a server restart.
    Users can no longer create a new item in the list when they do they get this error:
    The form contains the following errors:
    Field or group: my:Author
    Error: Cannot be blank
    When I try and preview it in infopath2010 it also does the same thing but provides a more detailed error:
    Infopath cannot submit the form because it contatains validation errors that are not in the current view. Errors are marked with a red astrick or red dashed boarder.
    If you cannot find an error in otherviews, there might be a problem with the forms design.
    I checked all thru the form for my:Author field and can't find it on the page as a control or in the list of fields. Any recommendations?
    Thanks!

    Didn't know you also created this as a thread.  If you send me a direct email in the future, please let me know you also created a thread so that I can answer publicly to help others and to get credit for the time/effort spent.  Thanks.SharePoint Architect || Microsoft MVP ||
    My Blog
    Planet Technologies ||
    SharePoint Task Force

  • How to Find the Queries that are not hitting the indexes..

    Guys,
    Hope you all doin well.
    Would you guys please tell me any view , or any resource that can help me to identify those SQL Statements that are not hitting the indexes properly, Causing the system to slow down at peak times.
    Thanks
    Rgrds
    Y.Vo.

    any resource that can help me to identify those SQL Statements that are not hitting the indexes properlyInteresting ! Is there any specific reason of looking only for those queries, which are not making proper use of indexes.
    hare krishna
    Alok

  • How do I delete pictures that are not on "camera Roll" that I transferd from my computer?

    I have tried everything..I have pictures on my phone that I transfered from my computer...they are old vaca pics and I want to delete them..They are not on the "camera roll"..I have tapped on edit, delete, ect everything and they won't delete..Please I hope someone can help me..
    Thanks

    Delete them on your computer then sync your iPhone.
    Or make sure when syncing your iPhone you remove them from the sync instructions.
    You cannot delete them directly from the IPhone.

  • Identifying tracks that are not in the iTunes Music Library

    I've got about 12,000 songs in my iTunes Music Library. Suppose I want to remove some of them, say 2,000 of them, and keep the files. The files will then remain on my computer but not show up in iTunes.
    Is there a utility that will display tracks that are in the iTunes Music folder but are not in the music library? I am sure I will not be able to keep track of which 2,000 tracks I took out of the library. Which means I could forget forever that I even have the music. I thought I saw a reference to a way to do this but I have not been able to figure it out.
    Thanks.

    I've got about 12,000 songs in my iTunes Music Library. Suppose I want to remove some of them, say 2,000 of them, and keep the files.
    I would create a new folder and drag these songs from iTunes to this folder then delete them from iTunes and click Yes when it asks to delete from library and delete form hard drive.Delete

Maybe you are looking for

  • Valuation clearing account

    Can anyone explain me what is the use of Valuation Clearing Account ? Transaction code 8KEN Documentation in IMG says In this step you specify profit and loss accounts for valuation differences that arise in business transactions between group compan

  • Is ther a BAPI or RFC that can read any table ?

    I want to read 35 tables in SAP database. Is ther a BAPI or RFC that can read any table ? If I use RFC to read these tables, I will write a lot of codes. It may be a large work.

  • Exporting list to excel..order changes?

    hello. thanks for the time and effort. i'm a SharePoint 2013 noob. so forgive the simple question.  we moved a team site from SharePoint 2010 to SharePoint 2013 and now a user is complaining that when they export to excel the list they see in IE the

  • Run midi file with IE 5.0 or 6.0

    I write an applet that play "sound.midi" and bundle it in a jar file.The jar file contains SoundApplet.class SimpleThread.class test.mid I can listen to the midi by appletviewer but it doesn't work with IE 5.0 or 6.0. What should I do?(I think the la

  • Reducing column width in /sapapo/sdp94 planning book

    Hi , I would like to reduce the width of the column for field APO Location . But I am not understanding where we can change these setting for fields . Fileds like SNP Plan  ,  APO location , unit ,  W30.2010 , W31.2010 like so on but I need to  reduc