BusinessObjects Board

Current Week day

Hello There,

I have a report which having the prompts for LogDate between start data and end date.

Now user has requested they have to give only Start date but not End date.
And End date should be automatically takes Current week and which falls on Monday always.

Ex: Start date is 01-07-2012
But End date is 16-07-2012(16th is Monday in the current week. And End date should be automatically has to come while running the report)

Could you please assist me.

Thanks in advance

Shravan


shravan_bo :india: (BOB member since 2006-04-25)

How 16-07-2012 is the Monday of Current week when Start Date = 1-7-2012 ?

Can you please explain ?


aniketp :uk: (BOB member since 2007-10-05)

I believe his users are asking for a ‘through Monday of the current week’ regardless of the start date they enter.

If thats the case, he just needs an object in the universe that always pulls in the Monday of the Current week.

And the calculation to do that changes drastically depending on which database he’s reporting against…

In MS SQL:


Dateadd(day,2-datepart(dw, GetDate()), getdate())

This code always gives you the Monday of the current week.

And should you need it:

DATEADD(DAY, -(DATEPART(dw,CONVERT(varchar(10),getdate(),101)) + 5), CONVERT(varchar(10),getdate(),101)) 

Gives you LAST week’s Monday.

Then when creating the report, simply set End Date = “Object from the universe” and select this object.

Someone else will need to post the code for Oracle, I’m horrible on that DB.

EDIT: Fixed Formulas…


JPetlev (BOB member since 2006-11-01)

Yes, that’s correct JPetlev.

DB is Oracle 10G. Is this function will work?

Thanks for the reply.

Shravan


shravan_bo :india: (BOB member since 2006-04-25)

There is a “sticky” topic at the top of this forum that contains some relative date Oracle functions / formulas. Have you checked to see if the one you need is there?


Dave Rathbun :us: (BOB member since 2002-06-06)

Dave,

Ever so slightly off topic but as a BO guru have you experienced attempting these native expressions in a UNX file with multiple sources?

We’re having all sorts of technical problems in BO 4 SP4.


The Emu :australia: (BOB member since 2002-09-13)