-
1. Re: Date Prior and Quarter wise
Mavis LiuJun 12, 2018 4:16 AM (in response to veeru G)
Hi Veeru,
Use this:
if YEAR([DATE])<2017
then '2016 and Prior'
else str( YEAR([DATE])) + ' Q' + str( DATEPART('quarter', [DATE]))
END
Please see attached example.
Thanks,
Mavis
-
Dates calc_v10.2_v10.2.twbx 7.4 MB
-
-
2. Re: Date Prior and Quarter wise
Kishor c Jun 12, 2018 4:16 AM (in response to veeru G)Hi Veeru,
attach a sample work book.
kishor
-
3. Re: Date Prior and Quarter wise
Zhouyi ZhangJun 12, 2018 4:32 AM (in response to veeru G)
-
Book1_v10.2.twbx 1.2 MB
-
-
4. Re: Date Prior and Quarter wise
Kishor c Jun 12, 2018 4:37 AM (in response to veeru G)Hi Veeru,
max year :
{ FIXED : DATEPART('year' ,max([Order Date]))}
new date :
if DATEDIFF('year', [Order Date] , MAKEDATE([current year],1,1) )>=2
then MAKEDATE([current year]-2,1,1)
ELSE [Order Date]
end
-
5. Re: Date Prior and Quarter wise
veeru G Jun 12, 2018 4:47 AM (in response to Mavis Liu)Hi Mavis,
Thanks for your reply. Here one small change i done because of 2019 data will come it will not automatically changes 2017 & Prior.
IF YEAR([NEW ORDER DATE]) <= YEAR(DATEADD('year',-2,TODAY()))
THEN STR(YEAR(DATEADD('year',-2,TODAY())))+'and Prior'
ELSE
str( YEAR([NEW ORDER DATE])) + ' Q' + str( DATEPART('quarter', [NEW ORDER DATE]))
END