Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

last 6 months record from existing qvd

Hi All,

I need your help to retrieve the last 6 months record from the existing qvd file. Please find below sample.Thanks.

Load submittedon,

         scenarioID

from qvd

where submittedon>=currentdate-6 months

1 Solution

Accepted Solutions
Not applicable

Re: last 6 months record from existing qvd

Hi,

     Try the below code .

\

Load submittedon,

         scenarioID

from qvd

where fabs( submittedon)>=fabs(Addmonths(Toda(),-6)) ;

//Yusuf

8 Replies
sujeetsingh
Honored Contributor III

Re: last 6 months record from existing qvd

So what about your sample script ..it seems right .

Not applicable

Re: last 6 months record from existing qvd

Hi,

     Try the below code .

\

Load submittedon,

         scenarioID

from qvd

where fabs( submittedon)>=fabs(Addmonths(Toda(),-6)) ;

//Yusuf

Re: last 6 months record from existing qvd

Try this.

    

     Load * from xyx  where Date >= addmonths(today(),-6);

     this will give exact last 6 month data meaning if today is 12th July 2013 then it will give data from 12th Jan 2013.

     If you need data from 1st Jan 2013 that is last 6th months start date. then try below

     Load * from xyx where Date >= monthstart(addmonths(today(),-6));

Regards,

Kaushik Solanki

sushil353
Honored Contributor II

Re: last 6 months record from existing qvd

try this:

where submittedon>= date(addmonths(today(),-6),'DD/MM/YYYY')

make sure that submittedon and date(addmonths(today(),-6),'DD/MM/YYYY') should have date format.

HTH

Sushil

er_mohit
Honored Contributor II

Re: last 6 months record from existing qvd

Hope it helps you

where submittedon>=TODAY()- month(6)

sreenivas
Contributor III

Re: last 6 months record from existing qvd

Hi

Check this Condition

LOAD Date,   

     Val

 

FROM

C:\Users\sreenivas.i\Desktop\Book1.xlsx

(ooxml, embedded labels, table is Sheet1)

Where Date >= addmonths(monthend(today()),-7) and Date < monthstart(today());

Not applicable

Re: last 6 months record from existing qvd

Hi,

Try this

Load submittedon,

         scenarioID

from qvd

where submittedon>=month(today())-6

Selva

Not applicable

Re: last 6 months record from existing qvd

Thanks all for your kind reply. I am now able retrieve the last 6 months by using

fabs( submittedon)>=fabs(Addmonths(Toda(),-6)) ;

Community Browser