BusinessObjects Board

Week To Date, Month To Date

Hi All:
Could someone tell me how to calculate WTD in Universe? Our week starts from last Thursday to this Wednesday so I cannot use the Week (Date) function. Once I calculate the date, I will only need to calculate MTD, QTD, YTD. My database is SQL Server if that helps.

Thanks in advance
Sami


samistl (BOB member since 2012-12-26)

No one?


samistl (BOB member since 2012-12-26)

This sticky might help


Nick Daniels :uk: (BOB member since 2002-08-15)

Check your database setting because with oracle there is a twist that in Europe a week starts on monday as day 1, American it’s sunday as day 1.
Dont know if this is true in sql.
But i thought i had a challenge with from sunday :wink:

I would make a per week that shows per that last thursday - full day
something like
if friday -1
if saterday - 2
if sunday - 3
if monday - 4
if tuesday - 5
if wednesday -6
else thurdays

Or if you can truncate to week code you can use that date and manipulate that date incase of su-wed

You keep you original date time and create this as a new date object
for example WTD(Thursday)

Doing this with mtd etc if you need to have this working with the thursday weeks you will need to make it so you manipulate with functions.


IngeH :netherlands: (BOB member since 2004-06-22)