Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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


Labels (1)
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))