BOB: Business Objects Board
Not endorsed by or affiliated with SAP

Register | Login 

Follow BOB on Twitter! 
Follow BOB on Twitter! (Opens a new window)  

General Notice: No events within the next 45 days.

How to Implement a Dynamic Date Filter in a Job?


 
Search this topic... | Search DI: Designer and Job Design... | Search Box
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Author Message
Hope
Principal Member
Principal Member



Joined: 29 Mar 2011

Posts: 104


flag
PostPosted: Thu Nov 29, 2018 9:55 pm 
Post subject: How to Implement a Dynamic Date Filter in a Job?

I have a job that runs once every week. I need to filter the data for previous week. If , for example, my job runs every monday, I need the data to be from previous week, lets say, previous monday to sunday. Does anyone has any insight as to how to accomplish this in data services?
Thanks.
Back to top
haraldur
Forum Member
Forum Member



Joined: 16 May 2006

Posts: 4
Location: Iceland


flag
PostPosted: Wed Dec 05, 2018 3:46 pm 
Post subject: Re: How to Implement a Dynamic Date Filter in a Job?

Hi,

Here is one solution for you.
You could create 2 global variables and assign value to them in a script before the dataflow runs.

The variables should be date.
$G_DateTo = to_date(to_char(sysdate()-1,'yyyymmdd'),'yyyymmdd');
$G_DateFrom = $G_DateTo - 7;

the to_date(to_char(sysdate(),'yyyymmdd'),'yyyymmdd') is to remove the time from sysdate().

Then you could add a where clause in a query
tablename.date_column >= $G_DateFrom and
tablename.date_column <= $G_DateTo.

If you are using a SQL Transform as a source you could add it like this:
tablename.date_column >= [$G_DateFrom] and
tablename.date_column <= [$G_DateTo].


Hope this helps
Back to top
Display posts from previous:   
Register or Login to Post    Forum Index -> Data Integrator -> DI: Designer and Job Design  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT - 5 Hours
 
Jump to:  

Index | About | FAQ | RAG | Privacy | Search |  Register |  Login 

Get community updates via Twitter:

Not endorsed by or affiliated with SAP
Powered by phpBB © phpBB Group
Generated in 0.0300 seconds using 17 queries. (SQL 0.0031 Parse 0.0009 Other 0.0260)
CCBot/2.0 (https://commoncrawl.org/faq/)
Hosted by ForumTopics.com | Terms of Service
phpBB Customizations by the phpBBDoctor.com
Shameless plug for MomentsOfLight.com Moments of Light Logo