Hello
I am trying to derive QTD from CURRENT_DATE. But the result is coming as "2016-Q2'
I just need '2'.
Eg of the Code: select QUARTER(current_date) from DUMMY
I am using below code to get the Quarter from M_TIME_DIMENSION. I extended this Table with YTD, MTD, QTD, QTD, CY, PY.
"QTD" = case when Quarter(current_date) >= "DATE_SAP"
then 'Y'
else 'N'
end.
I am referring to Justin's Blog
How To...Calculate YTD-MTD-anyTD using Date Dimensions
would appreciate any insight.
Thanks
Kalyan