Week Prompt

If user runs the report on Sun-Tue of a week, the previous week should not be available to select. If the user runs the report on Wed-Sat, user should be able to select previous week. Selections will be 100 historical weeks.


san83_deep (BOB member since 2007-11-25)

Welcome to Bob.

You need to create a Condition object along the lines of:

case when to_char(sysdate,‘Day’) = ‘Sunday’ then YOUR_DATE<to_number(to_char(trunc(SYSDATE),‘DD’))-7 else case when…

You then need to edit your LOV and include the object in the query.

I hope this helps,

Steve


steveayres :uk: (BOB member since 2006-11-23)

Thank you for your reply.
Can you explain me in detail.


san83_deep (BOB member since 2007-11-25)

san83_deep,

Apologies for not getting back to you sooner - I’ve had problems of my own!

I’m not sure whether you need clarification on the condition object, editing the LOV, or both.

So, if it is the condition object, do you have a week field on your table or are you building this up from date? Let me know and then I’ll think about the syntax although writing the condition object will take me a bit of time.

Have a look at this post and the link to Dave’s articles within it for some inspiration:

https://bobj-board.org/t/95795

Thinking about it, rather than editing the LOV of another object to then use in a prompt, you may as well combine the whole lot in a condition object, prompt as well.

Steve


steveayres :uk: (BOB member since 2006-11-23)

Thanks for getting back to me.

I have a time_wk_key in time_dim table, I like the idea of not editing the LOV.

Can you please provide me with the syntax to combine the whole lot (LOV) in the same condition object.

I really appreciate your help.


san83_deep (BOB member since 2007-11-25)