Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

Hi,

     Try the below code .

\

Load submittedon,

         scenarioID

from qvd

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

//Yusuf

View solution in original post

8 Replies
sujeetsingh
Master III
Master III

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

Not applicable
Author

Hi,

     Try the below code .

\

Load submittedon,

         scenarioID

from qvd

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

//Yusuf

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
sushil353
Master II
Master II

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
Master II
Master II

Hope it helps you

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

sreenivas
Creator III
Creator III

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
Author

Hi,

Try this

Load submittedon,

         scenarioID

from qvd

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

Selva

Not applicable
Author

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

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