Example 1 C#
In this example the calculation date is set to 2020-03. This will tell the calculation-engine that the ongoing account year is 2020-01-01 - 2020-12-31.
Default length of all fiscal years is 12 months and default start month is January. Default number of forcast years is 3 years.
The arrays ActualFigures.HistoricalIncomestatements and ActualFigures.HistoricalBalancesheets is always in cronological order and the last item is always the latest account year that is closed.
Input:
Field | 2017-01-01 | 2018-01-01 | 2019-01-01 | |
CalculationYear | 2020 | |||
CalculationMonth | 3 | |||
Revenue | 100 000 | 200 000 | 300 000 | |
Cash | 200 000 | 300 000 | 400 000 | |
Unrestricted equity | 200 000 | 300 000 | 400 000 |
Output read in this example:
The default forecast method for the field Revenue is an automatic choice between linear regression and weighted running average. In this case the calculation engine choosed the linear regression because it was the best fit.
The first three years is redunant information copied from the input. The last three years is the calculated forecast.
Field | 2017-01-01 | 2018-01-01 | 2019-01-01 | 2020-01-01 | 2021-01-01 | 2022-01-01 |
---|---|---|---|---|---|---|
Revenue | 100 000 | 200 000 | 300 000 | 400 000 | 500 000 | 600 000 |
Sourcecode:
var app = new ApplicationserviceImplSEIClient(); app.ClientCredentials.UserName.UserName = USERNAME; app.ClientCredentials.UserName.Password = PASSWORD; app.Endpoint.Address = new EndpointAddress(ENDPOINT); var input = new CompanyCalcInput { CalculationYear = 2020, CalculationMonth = 3, Companies = new Company[] { new Company { ID = System.Guid.NewGuid().ToString(), ActualFigures = new ActualFigures { HistoricalIncomestatements = new Incomestatement[] { new Incomestatement { Revenue = 100_000 }, new Incomestatement { Revenue = 200_000 }, new Incomestatement { Revenue = 300_000 } }, HistoricalBalanceSheet = new BalanceSheet[] { new BalanceSheet { Cash = 200_000, UnrestrictedEquity = 200_000 }, new BalanceSheet { Cash = 300_000, UnrestrictedEquity = 300_000 }, new BalanceSheet { Cash = 400_000, UnrestrictedEquity = 400_000 } } } } } }; var output = app.doActiveCompanyCalculation( new doActiveCompanyCalculation { CompanyCalcInput_1 = input }).result; Assert.AreEqual(100000.0, output.ResultsAfterLoanAdjusted[0].IncomeBalanceAndKPI.Incomestatement.Revenue, 0.0); Assert.AreEqual(200000.0, output.ResultsAfterLoanAdjusted[0].IncomeBalanceAndKPI.Incomestatement.Revenue, 0.0); Assert.AreEqual(300000.0, output.ResultsAfterLoanAdjusted[0].IncomeBalanceAndKPI.Incomestatement.Revenue, 0.0); Assert.AreEqual(400000.0, output.ResultsAfterLoanAdjusted[0].IncomeBalanceAndKPI.Incomestatement.Revenue, 0.0); Assert.AreEqual(500000.0, output.ResultsAfterLoanAdjusted[0].IncomeBalanceAndKPI.Incomestatement.Revenue, 0.0); Assert.AreEqual(600000.0, output.ResultsAfterLoanAdjusted[0].IncomeBalanceAndKPI.Incomestatement.Revenue, 0.0); |