Evolution of the amounts paid between two months - math

Can someone help me to apply the right formula to show the evolution of the paid amounts between two months, for instance :
In february :
Paid amounts = 30 Dollars
Turnover = 100 dollars
Evolution of Paid amounts are : 30%
In March :
Paid amounts = 20 Dollars
Turnover = 100 dollars
Evolution of Paid amounts are : 20%
Which formula is right To show the evolution between MARCH and FEBRUARY ?
(Paid ( March ) - Paid ( February ) ) * 100 / Paid ( February )
or
Percentage ( March ) - Percentage ( Fabruary )
Thank you :)

Related

extract the first number after a specific word in a text column [duplicate]

This question already has answers here:
Extract number after a certain word
(4 answers)
Closed 2 years ago.
I have some text data and I want to extract from it the first number after the word "expects earnings of". What I currently have is the following:
x <- d %>%
mutate(
expectsEarningsOf = str_match_all(newCol, "expects earnings of (.*?) cents")
)
Which extracts the text along with the number after the word "expects earnings of" and before the word "cents". I just want to now extract the first number after "expects earnings of". I thought about something:
x <- d %>%
mutate(
expectsEarningsOf = str_match_all(newCol, "expects earnings of (.*?) anyStringCharacter")
)
Where anyStringCharacter is any non numeric number.
Data:
d <- structure(list(grp = c(2635L, 1276L, 10799L, 10882L, 6307L, 7622L,
2448L, 6467L, 3224L, 2064L, 9232L, 5039L, 2888L, 5977L, 3565L
), newCol = c("For 2008, True Religion expects earnings of $1.48 to $1.52 a share and net sales of $210 million to $215 million. The company expects to incur additional marketing expenses of about $1.7 million. ",
"But Hospira also said it now expects net sales on a GAAP basis to grow at a rate of 1% to 2% this year, reduced from earlier expectations by lower-than-expected international sales and purchasing delays in the medication-management business. After the second quarter, the company had projected growth in a range of 3% to 5%. ",
"14 Nov 2013 16:04 EDT *Thermogenesis Sees Net Savings About $1.5 Million From Reorganization",
" The Company announced that net sales for this nine week period increased by 25.4% to $185.3 million while comparable store sales for this period decreased by 0.5%. Based on this quarter-to-date performance, the Company now expects net sales for the fourth quarter of fiscal 2013 to be in the range of $208 million to $210 million, comparable store sales to be in the range of -1.5% to -0.5% and GAAP net income to be in the range of $23.3 million to $24.3 million, with a GAAP diluted income per common share range of $0.43 to $0.45 on approximately 54.0 million estimated weighted average shares outstanding. Excluding $0.9 million, or $0.02 per adjusted diluted share in tax-effected expenses related to the founders' transaction(1) , adjusted net income is expected to be approximately $24.2 million to $25.2 million, or $0.44 to $0.46 per diluted share based on estimated adjusted diluted weighted average shares outstanding of approximately 54.6 million., 9 Jan 2014 16:45 EDT *Five Below, Inc. Updates 4Q Fiscal 2013 Guidance Based On Qtr-To-Date Results",
"", "1323 GMT Raiffeisen Centrobank calls Verbund's (VER.VI) recent guidance increase for 2014 a \"mixed bag,\" raising its target price to EUR15.60 from EUR14.30. The bank retains its hold rating as positive effects are mostly due to one-offs, although the utility's sustainable cost savings were a positive surprise. \"The power price environment is still bleak following a weakish outlook for Central European economies, coal prices falling further and only lacklustre hopes for a quick fix of the European energy and climate policy,\" Raiffeisen adds. Verbund's shares trade up 0.6% at EUR15.34. (Nicole.lundeen#wsj.com; #nicole_lundeen) ",
"As a result of its third quarter results and current fourth quarter outlook, the Company has updated its guidance for fiscal 2007. The Company now expects net sales to range from $2.68 billion to $2.7 billion, which compares to prior expectations of $2.7 billion to $2.75 billion. Same-store sales for the year are expected to increase approximately 2.5% to 3% compared to previous expectations of an increase of approximately 3.0% to 4.5%. The Company now expects full year net income to range from $2.37 to $2.43 per diluted share, which compares to its prior guidance of $2.49 to $2.56 per diluted share. ",
" Sempra Energy (SRE) sees earnings next year growing 15% from this year's estimate, putting 2010 expectations above Wall Street's, as the parent of San Diego Gas & Electric anticipates much lower capital spending for the next five years.",
"Outlook for 2008: Midpoint for EPS guidance increased, For the full year 2008, the company now expects results from continuing operations as follows: earnings per diluted share of between $3.10 and $3.20, compared to the previous range of $3.00 to $3.20; revenue growth of approximately 9%, and operating income to approach 17% of revenues. Over the same period, the company expects cash from operations to approximate $900 million and capital expenditures of between $240 million and $260 million. These estimates exclude potential special charges.",
"California Pizza Kitchen expects second-quarter earnings of 34 cents to 36 cents a share. Wall Street expects earnings of 36 cents a share. ",
" -- Q1 2013 gross margin within guidance, sales ahead of guidance , \"We achieved first quarter sales ahead of and gross margin in line with our guidance, and reiterate our expectation for a sales acceleration during the year, with a second quarter markedly stronger than the first quarter and a large second half, leading to expected 2013 full year net sales at a similar level to that of 2012. The underlying assumptions are unchanged, with foundry and logic preparing for very lithography-intensive 14-20 nm technology nodes to be used for next generation mobile end-products; while lithography investments in memory are still muted, memory chip price recovery and discussions on scanner shipment capability are signs of potential upside for second half deliveries. EUV technology industrialization continues to make steady progress on the trajectory set with the introduction of the improved source concept last year: firstly, the EUV light sources have now been demonstrated at 55 Watts with adequate dose control; secondly, the scanners themselves have demonstrated production-worthy, 10 nm node compatible imaging and overlay specifications. We therefore confirm our expectation of the ramp of EUV-enabled semiconductor production in 2015, supported by our NXE:3300B scanners, two of which are being prepared for shipment and installation in Q2 and Q3,\" said Eric Meurice, President and Chief Executive Officer of ASML., -- For the second quarter of 2013, ASML expects net sales of about EUR 1.1 ",
"In the first quarter, Covanceexpects earnings of 60 cents a share on a modest sequential increase in net revenues. Analysts predicted income of 66 cents share on $534 million in revenue, which is nearly flat with the latest quarter's revenue.",
"The company said Monday it expects to report revenue of about $875 million for 2007, up sharply from $196 million in 2006, mostly because of new military contracts. However, it expects net income to remain nearly the same at $16.6 million. ",
"For the fourth quarter, the company sees earnings of $1.13 to $1.16 a share. ",
"Chip maker now expects earnings from continuing operations of 15c-17c a share, excluding restructuring charges, and a revenue decline of 25% to 30% sequentially, because of weak demand. Shares fall 6% late., Chip maker now expects earnings from continuing operations of 15c-17c a share, excluding restructuring charges, and a revenue decline of 25% to 30% sequentially, because of weak demand. Shares fall 6% late."
)), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA,
-15L))
The first number after "expects earnings of":
library(stringr)
str_extract_all(d$newCol, "(?<=expects earnings of )\\d+")
This solution uses positive lookbehind in (?<=expects earnings of ), encoding an instruction to match \\d+if it is immediately preceded by expects earnings of (with a white space).

How can i calculate price from discount given by supplier in a purchase order?

I have a sample value as shown below
$item_A = $ 112.50 # 6% tax after tax = 9.25
$item_B = $ 10.00 # 0% tax
//I bought 2 item_A ($ 238.50) and 1 item_B ($ 10)
$sub_total = $ 235.00
$tax_amt = $ 13.50
$total = $ 248.50
At here i want to apply a discount $40 and then share among on the items price, which mean my total should be $208.75 after discounted.
discount will be based on setting either applied before or after tax of total amount
// formula to share among
$distribute = sub-total of item / total amount * discount
After get the $distribute, then will divide the quantity and add to the current unit price.
In this case, if i am recalculating the total amount, it will became lesser due to the unit price of item applied the discount.
My expected result is when applied $40 discount on $248.50, it will became $208.50 with a $40 discount applied even recalculate it.
is it need to remain the tax amount of the original price?
What is the solution to use to deal with this situation? Anyone can help and give suggestion on this case? Thanks.

Prorated allocation of resources

Each month a certain number of resources are made available.
There's a defined 'usage' rate from months 0 to month n
For ex, in the month of release, 10% of resources are used, 12% additionally in second month, & 15% additionally in third month, so on & so forth until the maximum available resources are used.
required::
How many resources are used each month.
for example,
in month 1, there are 10% of the resources released in month 1
in month 2, there are 12% of resources released in month 1 + 10% of resources released in month 2
in month 3, there are 15% of resources released in month 1 + 12 % of resources released in month 2 + 10% of resources released in month 3
& so on..
The logic is implemented in Excel thus: http://www.mrexcel.com/forum/excel-questions/752098-array-formula-allocate-revenues-across-periods.html
How can I implement this in R?
Thank you for your help!
Have a look at cumsum()
> used<-c(0.1,0.12,0.15)
> cumsum(used)
[1] 0.10 0.22 0.37
Hope this is what you were looking for.

how to compound the interest monthly in recurring deposit calculation?

how to calculate recurring deposit in monthly basis?
M = ( R * [(1+r)n - 1 ] ) / (1-(1+r)-1/3)
M is Maturity value
R is deposit amount
r is rate of interest
n is number of quarters
if i take 'n' as 4(no of Quarters) for 1 year its showing yearly Maturity value.can anyone tel me how to do monthly calculation.Thanks
I'm not sure what the 1/3 is doing in the denominator, could you explain that? As integer division it will likely evaluate to 0 anyway.
That said, the formula for payment at the end of each payment interval is indeed
M = R * ( (1+r/p)^n-1 )/( (1+r/p) -1) = R * p/r * ( (1+r/p)^n-1 )
resulting in M = 125365.3694 for the given data;
and for payments at the start of each payment interval (month, quarter, ...)
M = R * (1+r/p)*( (1+r/p)^n-1 )/( (1+r/p) -1) = R * (p/r+1) * ( (1+r/p)^n-1 )
resulting in M = 126357.8452 for the given data.
Here p is the number of parts of the year that is used, i.e., p=4 for quarterly and p=12 for monthly, n is the number of payments, i.e., the payment schedule lasts n/p years, and then r is the nominal annual interest rate, used in r/p to give the interest rate over each part of the year.
Note that the effective interest rate (1+r/p)^p-1 depends on p, for p=1 it is r, for very large p it approaches exp(r)-1.
A more realistic result is obtained by taking the number of days in each month into account
days:=[31,28,31,30,31,30,31,31,30,31,30,31];
for k in [1..12] do
sum:=0;
for j in [1..12] do
sum+:=1;
sum*:=1+days[(j+k-1) mod 12 + 1]*0.095/365;
end for;
k, sum*10000;
end for;
gives as result the maturity value if started in month[k], with k=1 corresponding to january
1 126402.9195
2 126324.3970
3 126343.1642
4 126329.4573
5 126348.2653
6 126334.5983
7 126353.4478
8 126372.4494
9 126358.9711
10 126378.0173
11 126364.5825
12 126383.6740

How to create a growth column or a share column in an SQL Server 2008 Cube Development?

I have a huge amount of sales data starting from 2000 till 2009. I want to calculate growth on 2009 sales versus 2008 sales.
I also want to calculate share of each product in any particular year or month.
Best Regards
Wajih
If you are talking straight MDX you could do something like:
Code Snippet
(
Sum( MTD( [Date].[Calendar].[Date].[21.10.2008] ),
[Measures].[Sales] )
-
Sum( MTD( ParallelPeriod( [Date].[Calendar].[Year], 1,
[Date].[Calendar].[Date].[21.10.2008] ) ),
[Measures].[Sales] )
)
/
Sum( MTD( ParallelPeriod( [Date].[Calendar].[Year], 1,
[Date].[Calendar].[Date].[21.10.2008] ) ),
[Measures].[Sales] )
You could also make it a KPI value using the KPI tab in VS Business Intelligence Dev Studio.
It all depends on how you want to reference it (i.e., in Excel 2007 or through some third-party reporting tool).

Resources