Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a strange situation.
FiscalPeriod is the only field available as below
FiscalPeriod |
2016001 |
2016002 |
2016003 |
2016004 |
2016005 |
2016006 |
2016007 |
2016008 |
2016009 |
2016010 |
2016011 |
2016012 |
2017001 |
2017002 |
2017003 |
2017004 |
2017005 |
2017006 |
2017007 |
2017008 |
2017009 |
2017010 |
2017011 |
2017012 |
I need to obtain as below
FiscalPeriod | FiscalQuarter |
2016001 | Oct-Dec 2015 |
2016002 | Oct-Dec 2015 |
2016003 | Oct-Dec 2015 |
2016004 | Jan-Mar 2016 |
2016005 | Jan-Mar 2016 |
2016006 | Jan-Mar 2016 |
2016007 | Apr-Jun 2016 |
2016008 | Apr-Jun 2016 |
2016009 | Apr-Jun 2016 |
2016010 | Jul-Sep 2016 |
2016011 | Jul-Sep 2016 |
2016012 | Jul-Sep 2016 |
2017001 | Oct-Dec 2016 |
2017002 | Oct-Dec 2016 |
2017003 | Oct-Dec 2016 |
2017004 | Jan-Mar 2017 |
2017005 | Jan-Mar 2017 |
2017006 | Jan-Mar 2017 |
2017007 | Apr-Jun 2017 |
2017008 | Apr-Jun 2017 |
2017009 | Apr-Jun 2017 |
2017010 | Jul-Sep 2017 |
2017011 | Jul-Sep 2017 |
2017012 | Jul-Sep 2017 |
Is it possible?
Yes, It is possible. Try this
Load FiscalPeriod, QuarterName(AddMonths(FiscalPeriod,-3)) as FiscalQuarter;
LOAD Date(Date#(FiscalPeriod,'YYYYMM'),'YYYY-MM') as FiscalPeriod;
LOAD * Inline [
FiscalPeriod
2016001
2016002
2016003
2016004
2016005
2016006
2016007
2016008
2016009
2016010
2016011
2016012
2017001
2017002
2017003
2017004
2017005
2017006
2017007
2017008
2017009
2017010
2017011
2017012
];
Yes, It is possible. Try this
Load FiscalPeriod, QuarterName(AddMonths(FiscalPeriod,-3)) as FiscalQuarter;
LOAD Date(Date#(FiscalPeriod,'YYYYMM'),'YYYY-MM') as FiscalPeriod;
LOAD * Inline [
FiscalPeriod
2016001
2016002
2016003
2016004
2016005
2016006
2016007
2016008
2016009
2016010
2016011
2016012
2017001
2017002
2017003
2017004
2017005
2017006
2017007
2017008
2017009
2017010
2017011
2017012
];
Thanks a ton Anil Samineni...