Tuesday, October 29, 2013

OBIEE: Calculating First Day of Year, Quarter, Month in Answers / Analytics

The difference between syntax is highlighted:

First Day of Calendar Year: TIMESTAMPADD(SQL_TSI_DAY, -1*(DAYOFYEAR(CURRENT_DATE )-1) , CURRENT_DATE )
First Day of Calendar Quarter: TIMESTAMPADD(SQL_TSI_DAY, -1*(DAY_OF_QUARTER(CURRENT_DATE )-1) , CURRENT_DATE )
First Day of Calendar Month: TIMESTAMPADD(SQL_TSI_DAY, -1*(DAYOFMONTH(CURRENT_DATE )-1) , CURRENT_DATE )

Hope this helped!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.