Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Kakay_Ranas
New 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
New Contributor II

Re: Data does not match Month - YEAR filter

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

4 Replies
Support
Support

Re: Data does not match Month - YEAR filter

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.

 

Note: if this suggestion helps to resolve the issue or answers your question, it will be appreciated if you select the "Accept as Solution" option.
We encourage you to visit our Knowledge Base https://qliksupport.force.com/QS_CoveoSearch when trying to find a solution related and not limited to: errors, feature requests, product defects. You can also visit our Qlik Help portal https://help.qlik.com/
Kakay_Ranas
New Contributor II

Re: Data does not match Month - YEAR filter

It's varchar

Partner
Partner

Re: Data does not match Month - YEAR filter

Hi,

try to use Date#

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

Kakay_Ranas
New Contributor II

Re: Data does not match Month - YEAR filter

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