Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

QTD from CURRENT_DATE

$
0
0

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


Viewing all articles
Browse latest Browse all 5653

Trending Articles