• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data question on calculating percentages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data question on calculating percentages


  • Subject: Re: Core Data question on calculating percentages
  • From: John Timmer <email@hidden>
  • Date: Sat, 01 Oct 2005 10:39:13 -0400
  • Thread-topic: Core Data question on calculating percentages

You should be able to make a fetch of all Expenses, then use the @sum
operator to get the total.  You could either do this on the fly every time
it's needed, or in the "awakeFromFetch" and have your object observe its
managed object context for changes that include new entities or modified
expenses.

JT


> I have been trying to find a way to have an attribute in an Entity that will
> show me a percentage value. Example: you have an Entity "Expenses" that has
> attributes for "Expense Name", "Expense Amount", and "Percentage of total"
> Expenses". Where "Percentage of total" gives you the percentage the "Expense
> amount is of the total expenses. Is there an easy or not so easy way to do
> this. Have tried the @sum operator, fetch requests, etc. Seems like there
> should be a simple solution. Have searched the mail list but could not find
> anything. Any suggestions would be appreciated.


_______________________________________________
This mind intentionally left blank


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Core Data question on calculating percentages
      • From: Scott Redheffer <email@hidden>
  • Prev by Date: Invoking Force Quit from Cocoa?
  • Next by Date: NSMutableArray selector not recognised
  • Previous by thread: Re: Cocoa and signals (was Re: Invoking Force Quit from Cocoa?)
  • Next by thread: Re: Core Data question on calculating percentages
  • Index(es):
    • Date
    • Thread