Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi I have scenario,
In my database i have data like below
year Sales
2005 | 45 |
2006 | 54 |
2007 | 25 |
2008 | 56 |
2009 | 78 |
2010 | 31 |
2011 | 25 |
2012 | 26 |
2013 | 85 |
2014 | 57 |
2015 | 95 |
2016 | 64 |
I want add years more 20 like below
Year | SalesGrowthRate |
2005 | 45 |
2006 | 54 |
2007 | 25 |
2008 | 56 |
2009 | 78 |
2010 | 31 |
2011 | 25 |
2012 | 26 |
2013 | 85 |
2014 | 57 |
2015 | 95 |
2016 | 64 |
2017 | |
2018 | |
2019 | |
2020 | |
2021 | |
2022 | |
2023 | |
2024 | |
2025 | |
2026 | |
2027 | |
2028 | |
2029 | |
2030 | |
2031 | |
2032 | |
2033 | |
2034 |
For adding those above years what i need to do
Please do the needful
Thanks
Thiru
concatenate
load *
inline [
Year
2017 |
2018 |
2019 |
2020 |
2021 |
2022 |
2023 |
2024 |
2025 |
2026 |
2027 |
2028 |
2029 |
2030 |
2031 |
2032 |
2033 |
2034]; |
concatenate
load 2016+recno() as year autogenarate(20)
like this
aa:
load * inline [an
2016];
concatenate(aa)
load 2016+recno() as an autogenerate(20);
concatenate
load *
inline [
Year
2017 |
2018 |
2019 |
2020 |
2021 |
2022 |
2023 |
2024 |
2025 ] |
This should work
or
aa:
load * inline [year, Sales
2005, 45
2006, 54
2007, 25
2008, 56
2009, 78
2010, 31
2011, 25
2012, 26
2013, 85
2014, 57
2015, 95
2016, 64
];
max_year:
load distinct max(year) as year_max resident aa;
let v_max_year=peek('year_max',0,'max_year');
drop table max_year;
concatenate(aa)
load $(v_max_year)+recno() as year autogenerate(20);
Hi Thanks for your answer
If it is date stamp instead of year then this formula
let v_max_year=peek('year_max',0,'max_year'); will become
let v_max_year=addmonths(?
Please do the needful
i want to add months
Thanks
Thiru
pls try this
aa:
load * inline [year, Sales
2005, 45
2006, 54
2007, 25
2008, 56
2009, 78
2010, 31
2011, 25
2012, 26
2013, 85
2014, 57
2015, 95
2016, 64
];
max_year:
load distinct max(year) as year_max resident aa;
let v_max_year=peek('year_max',0,'max_year');
drop table max_year;
concatenate(aa)
load $(v_max_year)+recno() as year autogenerate(20);
left join(aa)
load * inline [month
1
2
3
4
5
6
7
8
9
10
11
12];
NoConcatenate
bb:
load *,
makedate(year,month,1) as date
resident aa;
drop table aa;