Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
dunnalahk123
Creator III
Creator III

How to get Last 6 months Data

Hi,

Can Some one help me how to filter Last 6 months data from current Date in Qlikview Load Script.

Example

Today Date is 5\15\2017 so it should go last 6 months date 11\15\2016.  so results should give me from 11\15\2016 to till date.

How can i give in Qlikview load script of where condition.

Best Regards,

Hk

8 Replies
MindaugasBacius
Partner - Specialist III
Partner - Specialist III

This might help:

Load *

From

Where Date >= AddMonth(Today(), -6)

;

Anonymous
Not applicable

sum({<[Ship Date]={'>=$(=addmonths(today(),-6))<=$(=today())'}>}Sales) ---Set analysis

let vfirstdate= today()

let venddate= addmonth(today(),-6)

calendar:

load date(vfisrtdate+iterno()-1) as Date

autogenerate 1

while $(venddate)<=$(vfirstdate);

add this to calendar

qlikview979
Specialist
Specialist

Hi

may be this is help full to you

Rolling Month

vinieme12
Champion III
Champion III

Read this post


Dates in Set Analysis


vLastMonth=      "=Date(Max(Month),'MMM-YY')";

v2ndLastMonth= "=Date(AddMonths(Max(Month),-1),'MMM-YY')";

vLast6Month= =Date(AddMonths(Max(Month),-5),'MMM-YY')

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
sanjay006
Creator
Creator

Hi HariKiran !

Use this:

Load *

From XYZ

Where Date >= AddMonth(Today(), -6);

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

In case you are willing to have a flag only. In the Calendar table add this:

Calendar:

Load *

     ,If(Date >= AddMonth(Today(), -6), 1, 0) as 6LastMonths

From

;

dunnalahk123
Creator III
Creator III
Author

Hi Bacius,

Thank You that Helps For now. 🙂

Sorry for delay in Responding.

Best Regards,

Hari

sanjay006
Creator
Creator

Plz find the attached file.You can change the expression as for your requirement.

For now m showing it for previous 6 months data.