Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
soniasweety
Valued Contributor III

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

Tags (2)
1 Solution

Accepted Solutions

Re: last one year data

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)';

7 Replies

Re: last one year data

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)

Re: last one year data

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
Valued Contributor III

Re: last one year data

yes

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

Re: last one year data

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

soniasweety
Valued Contributor III

Re: last one year data

i have date field  created    

in this format   MM/DD/YYYY

Re: last one year data

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)';

Partner
Partner

Re: last one year data

PFB the Solution Hope so it will help you.

Data:

Load *

From

DB Path

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