Core data tutorial

Hi All
does any one have a good example of core data tutorial
something like Staff / Financial year / Holidays
Staff = Staff details
Financial Year = 2009/10, 2010/11 etc
Holidays takes like... date from 01/05/2009 date to 10/05/2009 Type of holiday = Annual Leave Number of days = 10
so If i selected a member of staff it would show their detail and underneath box of finance years and then select a year and all the holidays they have take is displayed
?

did u check
http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/CoreDat a/Articles/cdFetching.html#//apple_ref/doc/uid/TP40002484-SW1
on the left hand side there are couple of examples listed. i have not checked those..maybe you should check those out.

Similar Messages

  • Enterprise App Development, easy as Core Data?

    I took Apple's Core Data tutorial and loved it. The ease of creating machine-local database interfaces similiar to what I've done in FileMaker over the years is awesome!
    However, I'm ultimately wanting to create a database back-end that sits on a server in the closet and a front-end made in xCode that could be installed on client computers around our office. I don't want to make a web app with a browser interface. I want to make a rich desktop interface for accessing our data.
    Is there a way to do this as elegantly and painlessly as Core Data? I've read about WebObjects and EOF but can't get a definitive sense that it is what I'm looking for. WebObjects is so "web"-centric that I can't tell if I can develop a desktop app using it.
    Anyone know what I need?

    Hi Ryan,
    I've read your three threads and have been idly thinking about them for a couple of days. I know nothing about this really so forgive the musings and thoughts. I read this one first so I chose it to reply to.
    When I first read it I initially thought "what's stopping you use CoreData?". It certainly easy enough to alter the location of the data file (and the datatype it's saved as), so presumably it would be possible to locate the data on an external volume somewhere and incorporate some form of mounting and error checking routines before the file is committed.
    Then I realised the obvious problem with this relative to what you're actually trying to achieve; namely multiple access by multiple people on various machines, presumably often at the same times. How do you manage simultaneous concurrent access to the same file? I started to then think that this still might be possible with CoreData but by taking a slightly different view. Perhaps implement the application as a desktop app that uses it's own data file on a local volume (probably the normal location ~/Library/Application Support/xxx) to keep changes separate from other users working at the same time and then write other code that manages synchronising with the main file(s) on the server volume. Perhaps using a versioning system like svn for this part. The app could then checkout the master datastore from the server, alter it, save it locally and then when the session's over call the versioning system to update and compare the changes.
    This might work if the situation fits but there's obviously large problems with users working on differing data in realtime and other such clumsiness.
    On the other hand, I think Cocoa can be used in the manner you want using NSConnection and Distributed Objects. Have a look at this tutorial at CocoaDevCentral about writing a client/server app. It also links to this article at Stepwise which also may be of some use. A must read would also be Apple's docs on the topic of Distributed Objects which are here.
    A well known app that offers multiple simultaneous user access to the same file is SubEthaEdit which might also be worth a look.
    I'm sorry I can't be any more help and hopefully someone more knowledgeable than I will chime in with better observations/solutions, but no matter which way you choose to approach the problem I think there's going to be some serious coding involved.

  • Import Xml data into Core Data

    Hi im very new here, im trying to find a tutorial to import a xml data into a core data and so i can publish it in a tableview
    Can somebody help me??
    thanks

    Hi,
             If you have already have the xml data then you need to parse the XML data (Using NSXMLParser Class), After parsing the data we need to maintain arrays to store this XML content. After getting the arrays with fully parsed data, you have to store this data in our Local Database (Core Data).  May be it helps for you.
    http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation /Classes/NSXMLParser_Class/Reference/Reference.html

  • Core Data questions (NSNumber)

    Hi,
    I'm a bit lost with cocoa programming (have done C/C++ in University, now trying to get into the whole user interface thing). I'm trying to do a simple Core Data application but there are things I don't understand.
    First, I have an NSForm in my main window. I'd like the user to enter values in those. But, one of my entitie's attribute should be an interger. The thing is, the values in an NSForm field is a string. I know I can switch the attribute's type to string, but is there a proper way of doing this?
    Second, I have an NSTextField that shows an integer (again it's a string, I'd like it to be an integer). I placed a button next to it to increment that number by one each time it's clicked. At the same time, that field is binded to an attribute wich I'd like to be updated each time to keep track of everything. How do I program the incrementation thing in cocoa? I know Objecive-C quite a bit, but I don't know how to get the job done (what to connect to what, where to put my code, what to overide, etc...).
    Any help would be appreciated!

    Well, first of all, most interface components in Cocoa inherits from the class NSControl, in this class you can fin the method -intValue and -setIntValue: to respectively get and set an int value, if you send an -setIntValue: message to a text field it'll display your integer as a string. If you send a -intValue message to a text field it'll try to parse the number in the text field and will return it or 0 otherwise.
    For your incrementing I would tell you to use bindings, but in that case I would let you read the Apple Documentation because I never really use it so I can't explain it properly.
    So, I'm going to tell you the traditional way to make that work. According to MVC design pattern (Model-View-Controller), you would use 3 levels, but I'll make it simpler and use only 2.
    You have to create a new class which will be a Controller, to do this you go into Interface Builder, in the MainMenu.nib you click the Classes tab, you select NSObject in the left column, you go Classes menu and you do "Subclass NSObject". You put a name for your class.
    Then you open an inspector window, you go in Attributes part where you can see outlets and actions. You add one outlet for your text field of type NSTextField, and you add one action named increment: (the colon is added automatically).
    Then you click on your class again in the MainMenu.nib Classes tab and in the Classes menu you choose Instantiate <your class name>. You'll see a blue cube appear in the Instances tab.
    You hold ctrl key and click on the cube then you drag to your NSTextField (a line should appear between the cube and the cursor) you drop the line on the NSTextField and connect the text field to the outlet in your inspector window.
    You do the same for the button, except that this time you drag from the button to the blue cube and you select the action you defined earlier.
    There you are, everything is set up in IB, now go back into the Classes tab, select your class again and in Classes menu choose "Create files for <your class name>", choose your project and validate. Close IB and save your nib, go on Xcode, select <your class name>.m and inside it put the code into your increment method :
    [textField setIntValue: [textField intValue] + 1];
    textField should be replaced by the name of the outlet you put. Then you can execute and you'll have a beautiful text field which value will be incremented by clicking on the button.
    You can check the Cocoa Tutorial in Apple documentation, there's way more in it than in my post, and there's illustrations to make everything clearer.

  • IPhone core data - fetched managed objects not being autoreleased on device (fine on simulator)

    I'm currently struggling with a core data issue with my app that defies (my) logic. I'm sure I'm doing something wrong but can't see what. I am doing a basic executeFetchRequest on my core data entity, but the array of managed objects returned never seems to be released ONLY when I run it on the iPhone, under the simulator it works exactly as expected. This is despite using an NSAutoreleasePool to ensure the memory footprint is minimised. I have also checked with Instruments and there are no leaks, just ever increasing allocations of memory (by '[NSManagedObject(_PFDynamicAccessorsAndPropertySupport) allocWithEntity:]'). In my actual app this eventually leads to a didReceiveMemoryWarning call. I have produced a minimal program that reproduces the problem below. I have tried various things such as faulting all the objects before draining the pool, but with no joy. If I provide an NSError pointer to the fetch no error is returned. There are no background threads running.
    +(natural_t) get_free_memory {
        mach_port_t host_port;
        mach_msg_type_number_t host_size;
        vm_size_t pagesize;
        host_port = mach_host_self();
        host_size = sizeof(vm_statistics_data_t) / sizeof(integer_t);
        host_page_size(host_port, &pagesize);
        vm_statistics_data_t vm_stat;
        if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, &host_size) != KERN_SUCCESS) {
            NSLog(@"Failed to fetch vm statistics");
            return 0;
        /* Stats in bytes */
        natural_t mem_free = vm_stat.free_count * pagesize;
        return mem_free;
    - (void)viewDidLoad
        [super viewDidLoad];
        // Set up the edit and add buttons.
        self.navigationItem.leftBarButtonItem = self.editButtonItem;
        UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject)];
        self.navigationItem.rightBarButtonItem = addButton;
        [addButton release];
        // Obtain the Managed Object Context
        NSManagedObjectContext *context = [(id)[[UIApplication sharedApplication] delegate] managedObjectContext];
        // Check the free memory before we start
        NSLog(@"INITIAL FREEMEM: %d", [RootViewController get_free_memory]);
        // Loop around a few times
        for(int i=0; i<20; i++) {
            // Create an autorelease pool just for this loop
            NSAutoreleasePool *looppool = [[NSAutoreleasePool alloc] init];
            // Check the free memory each time around the loop
            NSLog(@"FREEMEM: %d", [RootViewController get_free_memory]);
            // Create a minimal request
            NSEntityDescription *entityDescription = [NSEntityDescription                                                 
                                                  entityForName:@"TestEntity" inManagedObjectContext:context];
            // 'request' released after fetch to minimise use of autorelease pool       
            NSFetchRequest *request = [[NSFetchRequest alloc] init];
            [request setEntity:entityDescription];
            // Perform the fetch
            NSArray *array = [context executeFetchRequest:request error:nil];       
            [request release];
            // Drain the pool - should release the fetched managed objects?
            [looppool drain];
        // Check the free menory at the end
        NSLog(@"FINAL FREEMEM: %d", [RootViewController get_free_memory]);
    When I run the above on the simulator I get the following output (which looks reasonable to me):
    2011-06-06 09:50:28.123 renniksoft[937:207] INITIAL FREEMEM: 14782464
    2011-06-06 09:50:28.128 renniksoft[937:207] FREEMEM: 14807040
    2011-06-06 09:50:28.135 renniksoft[937:207] FREEMEM: 14831616
    2011-06-06 09:50:28.139 renniksoft[937:207] FREEMEM: 14852096
    2011-06-06 09:50:28.142 renniksoft[937:207] FREEMEM: 14872576
    2011-06-06 09:50:28.146 renniksoft[937:207] FREEMEM: 14897152
    2011-06-06 09:50:28.149 renniksoft[937:207] FREEMEM: 14917632
    2011-06-06 09:50:28.153 renniksoft[937:207] FREEMEM: 14938112
    2011-06-06 09:50:28.158 renniksoft[937:207] FREEMEM: 14962688
    2011-06-06 09:50:28.161 renniksoft[937:207] FREEMEM: 14983168
    2011-06-06 09:50:28.165 renniksoft[937:207] FREEMEM: 14741504
    2011-06-06 09:50:28.168 renniksoft[937:207] FREEMEM: 14770176
    2011-06-06 09:50:28.174 renniksoft[937:207] FREEMEM: 14790656
    2011-06-06 09:50:28.177 renniksoft[937:207] FREEMEM: 14811136
    2011-06-06 09:50:28.182 renniksoft[937:207] FREEMEM: 14831616
    2011-06-06 09:50:28.186 renniksoft[937:207] FREEMEM: 14589952
    2011-06-06 09:50:28.189 renniksoft[937:207] FREEMEM: 14610432
    2011-06-06 09:50:28.192 renniksoft[937:207] FREEMEM: 14630912
    2011-06-06 09:50:28.194 renniksoft[937:207] FREEMEM: 14651392
    2011-06-06 09:50:28.197 renniksoft[937:207] FREEMEM: 14671872
    2011-06-06 09:50:28.200 renniksoft[937:207] FREEMEM: 14692352
    2011-06-06 09:50:28.203 renniksoft[937:207] FINAL FREEMEM: 14716928
    However, when I run it on an actual iPhone 4 (4.3.3) I get the following result:
    2011-06-06 09:55:54.341 renniksoft[4727:707] INITIAL FREEMEM: 267927552
    2011-06-06 09:55:54.348 renniksoft[4727:707] FREEMEM: 267952128
    2011-06-06 09:55:54.702 renniksoft[4727:707] FREEMEM: 265818112
    2011-06-06 09:55:55.214 renniksoft[4727:707] FREEMEM: 265355264
    2011-06-06 09:55:55.714 renniksoft[4727:707] FREEMEM: 264892416
    2011-06-06 09:55:56.215 renniksoft[4727:707] FREEMEM: 264441856
    2011-06-06 09:55:56.713 renniksoft[4727:707] FREEMEM: 263979008
    2011-06-06 09:55:57.226 renniksoft[4727:707] FREEMEM: 264089600
    2011-06-06 09:55:57.721 renniksoft[4727:707] FREEMEM: 263630848
    2011-06-06 09:55:58.226 renniksoft[4727:707] FREEMEM: 263168000
    2011-06-06 09:55:58.726 renniksoft[4727:707] FREEMEM: 262705152
    2011-06-06 09:55:59.242 renniksoft[4727:707] FREEMEM: 262852608
    2011-06-06 09:55:59.737 renniksoft[4727:707] FREEMEM: 262389760
    2011-06-06 09:56:00.243 renniksoft[4727:707] FREEMEM: 261931008
    2011-06-06 09:56:00.751 renniksoft[4727:707] FREEMEM: 261992448
    2011-06-06 09:56:01.280 renniksoft[4727:707] FREEMEM: 261574656
    2011-06-06 09:56:01.774 renniksoft[4727:707] FREEMEM: 261148672
    2011-06-06 09:56:02.290 renniksoft[4727:707] FREEMEM: 260755456
    2011-06-06 09:56:02.820 renniksoft[4727:707] FREEMEM: 260837376
    2011-06-06 09:56:03.334 renniksoft[4727:707] FREEMEM: 260395008
    2011-06-06 09:56:03.825 renniksoft[4727:707] FREEMEM: 259932160
    2011-06-06 09:56:04.346 renniksoft[4727:707] FINAL FREEMEM: 259555328
    The amount of free memory reduces each time round the loop in proportion to the managed objects I fetch e.g. if I fetch twice as many objects then the free memory reduces twice as quickly - so I'm pretty confident it is the managed objects that are not being released. Note that the entities that are being fetched are very basic, just two attributes, a string and a 16 bit integer. There are 1000 of them being fetched in the examples above. The code I used to generate them is as follows:
    // Create test entities
    for(int i=0; i<1000; i++) {
        id entity = [NSEntityDescription insertNewObjectForEntityForName:@"TestEntity" inManagedObjectContext:context];
        [entity setValue:[NSString stringWithFormat:@"%d",i] forKey:@"name"];
        [entity setValue:[NSNumber numberWithInt:i] forKey:@"value"];
    if (![context save:nil]) {
        NSLog(@"Couldn't save");
    If anyone can explain to me what is going on I'd be very grateful! This issue is the only only one holding up the release of my app. It works beautifully on the simulator!!
    Please let me know if there's any more info I can supply.

    Update: I modified the above code so that the fetch (and looppool etc.) take place when a timer fires. This means that the fetches aren't blocked in viewDidLoad.
    The result of this is that the issue happens exactly as before, but the applicationDidReceiveMemoryWarning is fired as expected:
    2011-06-08 09:54:21.024 renniksoft[5993:707] FREEMEM: 6131712
    2011-06-08 09:54:22.922 renniksoft[5993:707] Received memory warning. Level=2
    2011-06-08 09:54:22.926 renniksoft[5993:707] applicationDidReceiveMemoryWarning
    2011-06-08 09:54:22.929 renniksoft[5993:707] FREEMEM: 5615616
    2011-06-08 09:54:22.932 renniksoft[5993:707] didReceiveMemoryWarning
    2011-06-08 09:54:22.935 renniksoft[5993:707] FREEMEM: 5656576

  • Best path for Core Data implementation

    Hi all,
    First post so pls go easy!
    I'm a seasoned Windows/Web App developer who has recently (3-4m) discovered Mac, Cocoa and Obj-C. I've been buried in Apple docs, Hillegass and Dalrymple books for some time now trying to get to the point where I'm ready to build the Cocoa project that I have in mind, which looks to be well suited to a Core Data based Application driven by SQLite. The data model is reasonably complex with around 10 inter-related entities which must retain data integrity.
    Anyway, onto the question... historically I would have built a class library to encapsulate the use of the data model and accessed that class library when events fired to do what needs to be done. The Cocoa solution appears to support this - presumably though creating my own framework that is then referenced by the Cocoa application. I can see though that there is another path where I skip the encapsulation and build a Core Data based Cocoa app directly.
    At a high level - is there a preference between the two approaches?
    The latter seems well documented/supported but I am synically thinking that is because it is more straightforward and clearly faster, are there other advantages such as performance.
    For background the app when running will follow similar form to Mail.app in terms of multi-view with some data tables and custom views in play.
    Thanks,
    Chris

    Hi K T - thanks.
    Bottom line I think is that encapsulation is a safety blanket that I probably need to let go of. CD ticks boxes on a theory level, subject to implementation not being too heavy it seems like the logical step. The only consideration was to encapsulate a framework built on the known methods, then move the framework to CD under the covers when ready - that seems a bit gutless though and almost definitely inefficient time wise. I guess that there is little point in encapsulating CD from the outset - feel like it just adds unnecessary work in addition to some degree of performance overhead?
    {quote}Are you looking for flexibility or performance, by the way?{quote}
    Performance - the data model is unlikely to change once bedded in beyond addition of properties etc very infrequently. The app is likely to need to handle many tens of thousands of rows of data (albeit small in terms of data volume per row) for some users, and my conclusion from the documentation was that SQLite is the most appropriate route if committing to CD where data volume and/or relationships are plentiful. Is that a fair assessment?
    {quote}Are you looking to mimic traditional application interfaces or to adopt trends that are currently unfolding?{quote}
    The app I plan to build desperately needs to be brought up to date - possibly even beyond the advanced UI that AppKit seems to offer by default IMO. That said I don't want to overcommit on the extent of the build, but I do want to turn heads without just slapping coverflow or similar in for the sake of it. If you have any references or examples for doable leading edge UI design on OSX they would be gratefully received.
    Thanks again for your help - really appreciate it.
    Chris

  • Problem with core data and attribute name "description"

    I have spent hours tying to figure out this problem.
    It appears that is you name an attribute "description", there can be problems at run-time.
    Perhaps, it is related to how I am doing things and letting interface builder do all the bindings.
    I create a core data application in Xcode.
    I create the entity with some attributes in Xcode and then I launch interface builder. I drag a "core data entity" object to the application window. I add a "Master/Detail View".
    I save the files and do a compile. When I click on the "add" button, something goes wrong and GDB launches and loads the stack frame into the debugger.
    I am using Xcode 3.1.2.

    description is the name of a method in the NSObject protocol; try to use another name for your attribute in CoreData, for example myDescription.

  • Best practice for core data managed objects

    Hello
    I'd like to konw if there is a document available listing the good practices when managing core data managed objects.
    For example should I keep those objects in memory in a singleton class, or save thme to the DB and load them when needed, ... I am trying to figure out how to manage Annotation views representing managed objects when using the MapKit.
    Thanks

    Seen this?
    Using Managed Objects

  • Should I use Core Data?

    I'm starting a new document-based application. Is Core Data the way of the future, or just a convenience for specific types of apps? That is, in the "old days" you would override -[NSDocument dataOfType:] and readFromData: to archive your objects. It seems appealing to use Core Data and get automatic archiving in XML, SQL, and binary all for free, but the tutorials I've gone through all seem directed at a very different kind of app than mine. (Rather database-like, but I suppose the demo has to look like something.) The old "Sketch" example, which uses old-style archiving, hasn't been updated in years. Which direction to go?

    Look up HyperCard in Wikipedia for a good explanation. In short, I'm developing a GUI-based mini-app environment, where users can create buttons & fields, and hook them up with an elementary scripting language. I've written the compiler & interpreter, am starting the surrounding framework.
    "Have you looked at the Apple HIGs lately?" Dude, I was reading "Inside Macintosh" back in 1984.
    Mobile platform? Since I'm using garbage collection, I'm shut out of iPhone/iPad, at least for the time being.

  • How to implement parent entity for core data

    Hi there.
    I am starting a document-based Core Data application (Cocoa) and developed the following data model;
    The 'invoice' entity is a parent entity of 'items', because ideally I would want there to be many items for each invoice. I guess my first point here is - is what I am trying to do going to be achieved using this method?
    If so, I have been trying several ways in Interface Builder to sort out how to implement this structure with cocoa bindings. I have made a Core Data app before, just with one entity. So this time, I have two separate instances of NSArrayController's connected to tables with relevant columns. I can add new 'invoice' entities fine, but I can't get corresponding 'items' to add.
    I tried setting the Managed Object Context of the 'item' NSArrayController to this;
    I thought this would resolve the issue, but I still have found no resolution to the problem.
    If anyone done something similar to this, I'd appreciate any help
    Thanks in advance,
    Ricky.

    Second, when you create a Core Data Document Based application, XCode generates the MyDocument class, derivating from NSPersistentDocument. This class is dedicated to maintain the Managed Object Model and the Managed Object Context of each document of your application.
    There is only one Context and generally one Model for each Document.
    In Interface Builder, the Managed Object Context must be bound to the managedObjectContext of the MyDocument instance: it's the File's owner of the myDocument.xib Nib file.
    It's not the case in your Nib File where the Managed Object Context is bound to the invoiceID of the Invoice Controller.
    It's difficult to help you without an overall knowledge of your application, perhaps could you create an InvoiceItem Controller and bind its Content Set to the relationship of your invoice.

  • Using core data with a database

    Here is where I am at. I have a trivia app in development that will have over 1000 questions, so a database is inevitable. We recently created a test sqlite database and read in some entries and it worked.
    We were looking into exploiting the features of Core Data in our app, but this would involve creating a set of managed objects, a context, and the essentials for a Core Data scheme to function, and then use these models to fetch data from a database.
    The database is not created yet. We are starting fresh and simply wish to see if we can use core data to work with a database that could be created once the model is in place. Is it possible to create a 1000 or more entry database whose entries could relate to a Core Data entity or set of entities, and then use Core Data to fetch the data from these entries as we please?

    We will not be reusing any code. I apologize for the confusion. This is the start of the app regarding database management, and we have not yet created the database that will hold the questions for this app.
    Alright, so you two are both suggesting to set up a model and allow the creation of the sqlite store, which if my research is correct, involves a .sqlite file with a "Z_" following each attribute, and then adding entries here. This sounds fair enough. I had not known if this was going against the mainstream use of core data or not.
    Thanks you two. I'm going to leave the question open for a little while longer to see if any other opinions come up.

  • Edit and save a Core Data entity?

    Sorry if this is a fairly obvious issue, but I honestly can't find anything..
    Every sample Core Data application I've come across has examples of inserting and deleting entities/objects. But I cannot find anything about editing and saving some attributes of an existing object. Is this possible??
    I'm using default core data/managed objects, not custom classes yet. I can insert, view, and delete objects from the context. But I want to be able to edit attributes, and NOT in a table cell. I want to open the object in a separate window (which I can do), edit the attributes in that window, and click a "Save" button to update the attributes of that particular object. I can't find anything that shows me how.
    I am thinking a work-around would be to remove the existing object and just create a new object with the data, but if I have relationships to other objects, it seems like doing that would mess them up. My other train of thought is, if I can't do this with default core data objects, what CAN I do it with? Do I need to create custom classes for the objects, or do I need to use an SQL database separately?
    Thanks...

    Apple has this to say about that...
    Entity-relationship modeling is a way to describe data structures that can be mapped to an object-oriented system. Since it comes from the database world, there is some terminology that is associated with it that you may not be familiar with. These terms are:
    Entities, specific pieces of information in a data model.
    Attributes, the components of an entity. These are usually simple scalar types, such as int, float, or double; C structures such as char *, NSPoint; or an instance of a primitive class, such as NSString, or NSNumber.
    Relationships, references that an entity can have to other entities. These relationships can be optional or required as well as one-to-one or one-to-many.
    Properties, a collective term for attributes and relationships.
    -=-
    Entities and Managed Objects
    Each entity definition in a managed object model requires the name of the entity and the name of the class used at runtime to represent that entity.
    http://developer.apple.com/macosx/coredata.html
    do I need to use an SQL database separately?
    Core Data support three different kinds of data store formats to save managed objects contexts to. These formats are:
    • XML file format
    • Binary archive file format
    • SQLite database file format
    ...which are you using now? That is a rhetorical question for you to ponder, actually.

  • Save NSArray into Core Data object

    How do I go about saving an array in a core data store?

    I'm not proficient, but you have to make a core data model in the interface for that which is like making an xml file, but with fields (very easy), and then you have to make a number of objects that handle the memory of the variables. It's something like one object for a persistent store, and then one object that mangages the persistent store and then a persistent store object or something. It's actually very clear if you read up on it in the documentation under Core Data or Persistant Store.

  • Core data and predicate on large volume

    Hi,
    In one of my current project requirement is to view product information in perticular date range.
    Input
    No. Of products  :- P1 P2 P3 P4 P5
    No of channels....:-  C1 C2 C3 C4
    No of regions     :- R1 R2 R3 R4
    Depending on any of the above combination user can select either "Daily" "Weekly" "Monthly" "Yearly"
    for daily for Perticular date there will be (5 produtcts *4 channel*4 regions)= 80 Combinations
    Daily :-so for 5 years it will be (80*365*5=1,46, 000) records
    Montly:- for monthly for 5 years :- 12 *5 = 60 so total 4800 records.
    quarterly for quarterly for 5 years :- 4 *5 = 20 so total (20*80) =1600 records.
    That means we can calculate all daliy monthly , quarterly and yerly using daily data.
    As user can varies the selected combination of product , channels and regions and can also slect the date range.
    Looking at the search criteria , we decided to load the data into core data and then use predicate to fetch teh data.
    Calculation formula:-
    Day :- On perticular date
    Weekly :- On friday i.e. end of week
    Monthly :- 31/30 month end date
    Quarterly :- March end date , Jun end date etc.
    Yearly 31st dec date
    But my questoion is ,
    1.Can we  use Daily model to fetch also monthly , quaterly and yearly information. Memory optimization good vs response time less
    2. Sepaarte data model for Daily , Monthly and quarterly . Yearly we can calculate from quarterly . [Response time good but duplicate data]
    Could anyone plesae suggest which is the best option to model this data ?

    Does this help?

  • Derived Values in Core Data

    Using Core Data - I have created a named NSManagedObject that has both a start time and end time.
    I'd like to display a list of these Session and I'd like the SECTION headers to break per day, based on a Session's start date. So, I'm storing a time - and I need to group by a date.
    Would I simply add a readonly property 'startDate' to the literal Session code (.h,.m) that Core Data generated from my data model - in which I would derive the start date from the start time? or would this be a case for declaring a 'transient' property in my Core Data model? I don't exactly know when to use or not to use Transient properties.
    It would be used as follows:
    fetchedResultsController_ =
    [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest
    managedObjectContext:managedObjectContext_
    sectionNameKeyPath:@"startDate"
    cacheName:cacheName];
    Will this manually defined property actually work in this method?
    -Luther

    Dear Abir,
    Thanks a lot for your exact reply.
    In tracking tab of UWL what you see is NOT the description given for workflow, it is the Work Item Text for that workflow.
    This is absoltely correct. I inserted the container variables in workitem text from PFTC as you suggested. It worked like a Magic!!!
    KR,
    Bharath

Maybe you are looking for

  • Material replication from R/3 to SRM - Issue with Material group

    Hello All,                   I am working on BADI PRODUCT_CUSTOMER2 and method MAP_R3_TO_CRM_MATERIALMaterial replication part from R/3 to SRM. I am using a Ztable to map r/3 material group to SRM material group(Product category). For example Materia

  • PgfLocked Yes after text inset

    I'm spinning off versions of some manuals for another division (same product, different paint), and decided that rather than entirely clone parallel FM files, I'd try having the main Flow A be a text inset from the defining instance of the product ma

  • HOW TO USE FUNCTION MODULE IN ALV

    hi guyz I developed an alv report using join statements .But i got all that fields in a function module. so how can i use function module in alv . if i got a function module with all the fileds do i need to use select statement. plz help me. thanks s

  • Bootstrapping Error: ALC-TTN-105-000 under linux

    As I deploied with Adobe LiveCycle Configuration Manager I got an error : ALC-TTN-105-000: Could not connect to bootstrap Servlet: Port [Connection refused] may be invalid I have checked with this command: netstat -an | find "8080. There was no servi

  • PDF annotation

    I really like the preview program and prefer it over adobe acrobat (reader). There is one thing I miss. To highlight text rather than areas the latter which is possible in preview. Does anyone know of another application that can highlight (not edit)