Displaying 3 results from an estimated 3 matches for "2017_18".
2017 Sep 11
4
Case statement in sqldf
...then '2015_16'
+ when ReportDate between '2016-04-01' and '2017-03-31'
+ then '2016_17'
+ when ReportDate between '2017-04-01' and '2018-03-3'
+ then '2017_18' else null
+ end as FY
+ from cr
+ where ReportDate >= '2012-04-01'
+ ")
Thanking you in advance
Kind regards,
Mangalani Peter Makananisa (0005786)
South African Revenue Service (SARS)
Specialist: Statistical S...
2017 Sep 11
0
Case statement in sqldf
...then '2015_16'
when ReportDate between '2016-04-01' and '2017-03-31'
then '2016_17'
when ReportDate between '2017-04-01' and '2018-03-31'
then '2017_18' else null
end as FY
from cr
where ReportDate >= '2012-04-01'
")
giving:
> cr2
ReportDate FY
1 2017-09-11 2017_18
Note that using as.yearqtr from zoo this alternative could be used:
library(zoo)
cr <-...
2017 Sep 11
0
Case statement in sqldf
...39;
> + when ReportDate between '2016-04-01' and '2017-03-31'
> + then '2016_17'
> + when ReportDate between '2017-04-01' and '2018-03-3'
> + then '2017_18' else null
> + end as FY
> + from cr
> + where ReportDate >= '2012-04-01'
> + ")
There was no cr object in any of the package I loaded although `lubridate` and `stringr` appear unnecessary and were om...