Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filters in backend script

Dear All,

I have to create an filter in the back end script where i want data as per the today and 100 days back data..

I have a date column as DATE([Main Date]) as [Main Date]..

What should i have to do...?

6 Replies
tresesco
MVP
MVP

Basic logic is like:

Load

          [Main Date]

From <> Where [Main Date]>=Today()-100;

Now you have to take care of the format of the data so that comparison under where clause could be made to filter.

israrkhan
Specialist II
Specialist II

You can try some thing like..

load * ,

Date(MinDate) as MinDate

from yourSource

where Date(MinDate) >= Date(Today()) -100

or..

load * ,

Date(MinDate) as MinDate

from yourSource

where num(MinDate) >= num(Today()) -100

Not applicable
Author

Is it possible to use 'If condition' between the table ...if yes please tell me the syntax..

tresesco
MVP
MVP

Rahul Yadav wrote:

Is it possible to use 'If condition' between the table ...if yes please tell me the syntax..

I could not understand your 'between the table'. Could you explain a bit more?

Not applicable
Author

Means

Load *,

If(maindate=Today() and Today() - '100',maindate,Null()) as maindate,

From Sourcedata;

can I use this..?

tresesco
MVP
MVP

Yes, may be more accurately like:

Load *,

     If(maindate>=Today() - 100,maindate,Null()) as maindate

From Sourcedata;