Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
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());

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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
Partner

PFB the Solution Hope so it will help you.

Data:

Load *

From

DB Path

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