[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: summing up incrementally

Subject: Re: summing up incrementally
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 19 Dec 2003 07:12:36 +0100
comulative
> > The increase over three years is 1.03 * 1.02 * 1.08 =~ 1.135 or 13.5%
> > so you will need a recursive template as xpath2 doesn't have a product
> > built in (or you could use saxon7's implementation of xpath 2 draft,
> > which does)
>
> Actually, I am not working with interest on a loan. I am working with
> the gross sales of chain stores. Each month in December the statistics
> give the percentage of increase from the previous year. So if in 1934
> the store increased its sales 5 percent, and then in 1935 increased it 7
> percent, the total increase from 1933 is 12 percent. I'm using the
> percent from a periodical, but I don't think the periodical adjusted for
> inflation, so I may have to do some additional math.
>
> But I get the idea of sum--thanks!

It is quite simple to see that the real comulative increase is the product
of percentages of yearly increases, not their sum.

E.g. two yearly increases of 50% each give 225% comulative increase. That is
1.5 x 1.5, or it may be calculated:

In case the value is 100 at start, it would be 150 after year 1.

An increase of 50% the second year is 50% of 150 -- that is 75.

The value at the end of the second year is 150 + 75 = 225

Therefore, the total increase is:  225/100 = 2.25 = 225%

Your approach to calculating the total increase is wrong -- e.g. in the
above case it woud give 100%, not 225%.



Dimitre Novatchev.
FXSL developer

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html


Dimitre Novatchev.
FXSL developer

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.