Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Cannot get data for previous month

Hello

My data set is looking at data from 01/04/2013  to the End of last month (Which at the the moment is: 31/07/2013)

However in the where clause I want to be able to get just the latest month's data I.e. July 2013 data

Cna someone kindly help me write the where clause where I always get the dataset for the entrity of last month.  This will need to be dynamic, so I can place it on the scheduler

 

LOAD

'EYE_ED_TOTAL_MONTH' as data_source,
RunMonthEye,
Quarter_NumberEye,
Current_Quarter,
Current_Month,
Current_Year,
Main_WeekEye,
ATTENDANCE_CATEGORY,
CONCLUSION_DATE_TIME,
MonthYear,
Eye_Week,
FROM
C:\QLIKVIEW\DEVELOPMENT\HP\QVD\EYE_ED_MonthEnd.qvd
(
qvd

)
WHERE

CONCLUSION_DATE_TIME>= DATE(MonthStart(Today())-1, 'DD/MM/YYY')
and

CONCLUSION_DATE_TIME<=dATE(MonthEnd(Today())-1, 'DD/MM/YYY')
;

CONCULSION DATE TIME comes out as a Date

RunMonthEye is a number

Current_Month is a number with July being a 4

Current_Quarter is a number with July being a 2

Can you provide any assistance please?

Thanks

Helen


1 Solution

Accepted Solutions
abeyphilip
Creator II
Creator II

See if this work as your where clause:

where MonthName(CONCLUSION_DATE_TIME)=MonthName(addmonths(Today(),-1))

View solution in original post

3 Replies
abeyphilip
Creator II
Creator II

See if this work as your where clause:

where MonthName(CONCLUSION_DATE_TIME)=MonthName(addmonths(Today(),-1))

helen_pip
Creator III
Creator III
Author

Hello Abey

Amazing!   Thank you, yes this works for me


jjordaan
Partner - Specialist
Partner - Specialist

You can also try this

Date(MonthStart(Today(),-1))