Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Kakay_Ranas
Contributor II
Contributor II

Data does not match Month - YEAR filter

Hi!

 

Thanks in advance to anyone who can help. I'm using a table for my dates, it has 2015-2021. In my Qlik table though, I only want to show up to present date in the selection. I'm getting the correct view but the data does not match. I used below to get MONTH - YEAR, for example I select AUGUST-2019, data from Sept is included unless I manually select dates within the month. I know I did something wrong, appreciate any help to correct it.

=IF(AP_FULLDATE < TODAY (),
Date(MonthStart(AP_FULLDATE),'MMM-YYYY'))

1 Solution

Accepted Solutions
Kakay_Ranas
Contributor II
Contributor II
Author

Thank you all for the feedback. I updated the query instead to remove future dates from my table and that solved it for me.

,DATE_PARAM AS (
SELECT PID_TYPE_ID, PID, PID_START_DATE, PID_END_DATE
FROM OPERATIONS_SANDBOX.OA_ADMIN_MASTER_PID
WHERE PID_TYPE_ID = 1 -- daily
AND PID_START_DATE >= '1/1/2019'
AND PID_END_DATE <= GETDATE()
ORDER BY PID

View solution in original post

4 Replies
NadiaB
Support
Support

Hi @Kakay_Ranas 

What data type is the date value? You might need to truncate the date value:

 

https://community.qlik.com/t5/QlikView-Scripting/Date-Flooring/m-p/1370625?_ga=2.182782310.196836740...

 

Kind Regards.

 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
Kakay_Ranas
Contributor II
Contributor II
Author

It's varchar

StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

try to use Date#

IF(Date#(AP_FULLDATE, 'date format') < TODAY (),
Date(MonthStart(Date#(AP_FULLDATE, 'date format') ),'MMM-YYYY'))

Kakay_Ranas
Contributor II
Contributor II
Author

Thank you all for the feedback. I updated the query instead to remove future dates from my table and that solved it for me.

,DATE_PARAM AS (
SELECT PID_TYPE_ID, PID, PID_START_DATE, PID_END_DATE
FROM OPERATIONS_SANDBOX.OA_ADMIN_MASTER_PID
WHERE PID_TYPE_ID = 1 -- daily
AND PID_START_DATE >= '1/1/2019'
AND PID_END_DATE <= GETDATE()
ORDER BY PID