Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm working with a dataset containing a bunch of accounts from various companies. Now I want to make a dimension for the years comming, why I call it 'Future years'. For this reason I'm trying use Load* inline.
This is some of my original dataset:
CompanyID | CompanyName | FiscalYear | Revenue | CostOfGoods | Equity | Taxes |
---|---|---|---|---|---|---|
1 | Carlsberg | 2018 | 100 | 9 | 10000 | 0.25 |
2 | Heineken | 2017 | 85 | 10 | 9000 | 0.20 |
I want to make a forecast of FY 2019, FY 2020, FY 2021 and so on and it has to be dynamic, that's I use max([FiscalYear]) to find the latest accounting year. I'm using the following Load* inline code, but it's not working well. Any ideas how to fix this?
"Future Development":
Load * Inline [
Year, FutureYears
2019, max([FiscalYear])+1
2020, max([FiscalYear])+2
2021, max([FiscalYear])+3
];
Thanks in advance
Hi try this,
Table1:
LOAD * Inline [
CompanyID, CompanyName, FiscalYear, Revenue, CostOfGoods, Equity, Taxes
1, Carlsberg, 2018, 100, 9, 10000, 0.25
2, Heineken, 2017, 85, 10, 9000, 0.20
];
tmpMax:
LOAD
max(FiscalYear) as FiscalYear
Resident Table1;
LET vYearMax1 = Peek('FiscalYear', '0', 'tmpMax')+1;
LET vYearMax2 = Peek('FiscalYear', '0', 'tmpMax')+2;
LET vYearMax3 = Peek('FiscalYear', '0', 'tmpMax')+3;
DROP Table tmpMax;
"Future Development":
Load * Inline [
Year, FutureYears
2019, $(vYearMax1)
2020, $(vYearMax2)
2021, $(vYearMax3)
];
Reguards
Hi try this,
Table1:
LOAD * Inline [
CompanyID, CompanyName, FiscalYear, Revenue, CostOfGoods, Equity, Taxes
1, Carlsberg, 2018, 100, 9, 10000, 0.25
2, Heineken, 2017, 85, 10, 9000, 0.20
];
tmpMax:
LOAD
max(FiscalYear) as FiscalYear
Resident Table1;
LET vYearMax1 = Peek('FiscalYear', '0', 'tmpMax')+1;
LET vYearMax2 = Peek('FiscalYear', '0', 'tmpMax')+2;
LET vYearMax3 = Peek('FiscalYear', '0', 'tmpMax')+3;
DROP Table tmpMax;
"Future Development":
Load * Inline [
Year, FutureYears
2019, $(vYearMax1)
2020, $(vYearMax2)
2021, $(vYearMax3)
];
Reguards
It worked, thank you!