Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
soniasweety
Master
Master

last one year data

Hi all,

i want to load last one year data  while loading to QVD  from DB

i have  a  Month Field    

CreatedMonth

201804

201805

201806   like that

and i have a  Quarter filed like below

2018Q1

2018Q2  like so on...

Thanks

Sony

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

You can alter the above script.

Let vVar = Date(AddMonths(Today(),-12),'MM/DD/YYYY');    //08/09/2017

Data:

Load *

From

DB Path Where Created >= '$(vVar)';

View solution in original post

7 Replies
Anil_Babu_Samineni

Use this?

Table:

Load * From Table;

Store Table into ../../Store.qvd (qvd) Where Year = Year(Today());

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
tamilarasu
Champion
Champion

Hi Sony,

Do you want to load the data from 201708 to till date? If so, try

Let vVar = Date(Monthend(AddMonths(Today(),-12)),'YYYYMM');    //201708

Data:

Load *

From

DB Path where CreatedMonth >= $(vVar);

soniasweety
Master
Master
Author

yes

i want the till date to last year same day(or  same quarter)  so how can i do this?

tamilarasu
Champion
Champion

If you want to load the data to last year same day, you need a date field.

soniasweety
Master
Master
Author

i have date field  created    

in this format   MM/DD/YYYY

tamilarasu
Champion
Champion

You can alter the above script.

Let vVar = Date(AddMonths(Today(),-12),'MM/DD/YYYY');    //08/09/2017

Data:

Load *

From

DB Path Where Created >= '$(vVar)';

vishalarote
Partner - Creator II
Partner - Creator II

PFB the Solution Hope so it will help you.

Data:

Load *

From

DB Path

where Date>=Daystart(today(),-365) and Date<=Today();