Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
cksuperlatif
Contributor III
Contributor III

Date field

Hi,

I loaded many table with many date field, and I want only data where Year(Date_Field) >= Year(Today()) - 2.

for example:

Year(Date_Paiemant) >= Year(Today()) - 2

Year(Date_Produit) >= Year(Today()) - 2

Year(Date_Commande) >= Year(Today()) - 2

Year(Date_Facture) >= Year(Today()) - 2

and many other in few table.

So, can I have something like that, perhaps at the beginning of my script

Year(Date_*) >= Year(Today()) - 2

4 Replies
sinanozdemir
Specialist III
Specialist III

You can use Where clause in the load script:

LOAD

     *

FROM/Resident Your_data_source_name

Where Year(Date_Field) >= Year(Today()) - 2;

Hope this helps.

JonnyPoole
Employee
Employee

If you are doing this multiple tables, you should set a variable:

let vFilterYear=Year(Today()) -2;

LOAD

     *

FROM/Resident Your_data_source_name

Where Year(Date_Field1) >= $(vFilterYear);


LOAD

     *

FROM/Resident Your_data_source_name

Where Year(Date_Field2) >= $(vFilterYear);


etc...

cksuperlatif
Contributor III
Contributor III
Author

Thank

cksuperlatif
Contributor III
Contributor III
Author

Thank