Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
mahitham
Creator II
Creator II

How to load last 1 week data

Hi Experts,

Can any one please help me on below requirement.

I have a date field like below.

Created On.png

I have converted above date format into DD/MM/YYYY format like below

Load 

ID,

Date(Floor(CreateedOn/ 86400000)+25569) as Date

From lib://Test.qvd;

Can any one please help me to load last 1 week data only from the above data load.

Thanks in advance.

 

3 Replies
DavidM
Partner - Creator II
Partner - Creator II

Hi, since you've already converted the numbers to date I would add resident load from the first table,

like this:

Load

ID,

Max(Week(Date))

Resident  Table1

Where Year(Date)>Year(Today())

Group by ID;

Where limits the data to current year (so you don't select max week from previous years). Depends on your data if you want Max or Max-1 week.

mahitham
Creator II
Creator II
Author

Hi @DavidM ,

Thanks for your reply. There are many fields in the table apart from ID ,

Is there any way to do this without group by.

In the load I have the data upto  28/08/2019 from that date it has to extract the last 1 week data.

Please help me on this.

Thanks in advance.

DavidM
Partner - Creator II
Partner - Creator II

In that case do the resident load as I showed above but use inner join on Table1 (where you need to add also Week field - be sure to use same name as in the 2nd table).