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: 
erric3210
Creator
Creator

Date Format Issue

Hi All,

I'm getting Date Format issue. I've tried all possible methods but not getting the desired format.

Due to this I'm getting duplicates in Dates. See this:

Duplicates Date Format Issue.png

 

Here is the code I'm using:

Table_1:
LOAD// Date1 AS Date2,
// Date(Date#(Date1,'DD/MM/YYYY'),'YYYY-MM') AS Date2_1,
Date(Date1,'YYYY-MM') AS Date11,
Date(Date1,'YYYY-MM') AS Temp_Date
FROM
[..\Date1.xlsx]
(ooxml, embedded labels, table is Sheet1);

CONCATENATE(Table_1)
LOAD
// Date2 AS Date1,
Date(Date#(Date2,'YYYY-MM'),'YYYY-MM') AS Date11
FROM
[..\Date2.xlsx]
(ooxml, embedded labels, table is Sheet1)

WHERE NOT EXISTS(Temp_Date,Date(Date#(Date2,'YYYY-MM'),'YYYY-MM'));

 

Also, when using "Date1" table and modify the "date1" field using Date# function then it is returning blank.

I'm doing this:

Date(Date#(Date1,'DD/MM/YYYY'),'YYYY-MM') AS New_1

This is returning null date.

Attaching the sample data.

Please help and tell me the theory behind this issue.

 

Regards,

Eric

Labels (1)
2 Replies
Or
MVP
MVP

Date() does not change the underlying dates, it just formats the result in a specific manner, so for example July 1st and July 15th formatted as YYYY-MM would both return 2022-07 but have different underlying values. If you'd like to get month-level results, use e.g. MonthName(YourField) or MonthStart(YourField), which would actually change the underlying dates, before formatting as desired.

Bill_Britt
Former Employee
Former Employee

HI,

 

Have you thought about creating a master calendar? 

 

https://community.qlik.com/t5/QlikView-App-Dev/Creating-A-Master-Calendar/td-p/341286

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.