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

Date Fomat

Hi,

I have an issue related to date format. Appreciate if you can give some help. 

 

Per screen shot #1:

> This is my data source, from column C: the dates are showing as e.g. 21/10/2021 i.e. 21 Oct 2021

 

Per screen shot #2:

> You may see how I load the data to Qlik, and I have created 2 columns “Statement Date” and “Statement Date 2”

 

Per screen shot #3:

> I have created 2 bar charts, basically they are the same except one is with “Statement Date” and the other with “Statement Date 2”

> All looked fine until…

 

Per screen shot #4:

> I clicked on the first bar with “Jan 2021” on the “bar chart  in Statement Date 2”

> I saw the breakdown on the “ bar chart in Statement Date” but it’s showing as “01/10/2021” i.e. 1 Oct 2021 but not Jan 2021!

 

I think I have to define the date format of my data source to start with but I do not know how. Anyone can shed some light? Thanks.

 

Regards, CFung

1 Solution

Accepted Solutions
CFung
Contributor II
Contributor II
Author

Hello, 

 

I have just added a Master calendar to my Data Load Editor and now things are working fine.  I still do not know what went wrong with my previous setting. But adding the Master Calendar does help. 

 

Many thanks! 

View solution in original post

11 Replies
NitinK7
Specialist
Specialist

can you attach here your sample data, this would he helpful to find the correct solution.

CFung
Contributor II
Contributor II
Author

Please see attached. Those cells in light blue (I have removed the information on purpose). Many thanks for your assistance. 

 

NitinK7
Specialist
Specialist

try to add below script  at script editor.

Date("Stmt Date",'DD/MM/YYYY') as "Stmt Date",
Date(Date#(MonthStart("Stmt Date"),'MM/DD/YYYY'),'DD/MM/YYYY') as "Stmt Date2",

 

NitinK7_0-1635175641017.png

 

CFung
Contributor II
Contributor II
Author

Hi NitinK7,
Not sure if I understood you correctly.
See #5 - I tried what you suggested

CFung_0-1635244391517.png

 


See #6 - I could not see expected results - column was empty.

CFung_3-1635244566287.png

 

 

 

May I ask if you could assist further?
Many thanks.

NitinK7
Specialist
Specialist

try below, its working for me

Date("Stmt Date",'DD/MM/YYYY') as "Stmt Date1",
Date(Date#(MonthStart("Stmt Date"),'MM/DD/YYYY'),'MMM-YYYY') as "Stmt Date2",
Date(MonthStart(Num#(Date#("Stmt Date",'MM/DD/YYYY'))),'MMM-YYYY') as "Stmt Date3",

NitinK7_0-1635248985175.png

NitinK7_1-1635249034890.png

 

 

 

CFung
Contributor II
Contributor II
Author

Hi NitinK7, 

 

I have directly copy and paste your suggestion to Qlik

CFung_0-1635320908518.png

 

 

But I got different results:

> "Stmt Date2": still incorrect month and day format

> "Stmt Date3": completely empty. 

 

Can it be because of some settings issue? 

Appreciate if you can assist further. Many thanks. 

 

 

CFung_1-1635321000317.png

 

 

NitinK7
Specialist
Specialist

your data comes from database or excel file??

and please share your main page script like below or if possible then please attach here your .qvf file as well

NitinK7_0-1635321770118.png

 

CFung
Contributor II
Contributor II
Author

Hi NitinK7, 

This is from the main page. 

CFung_1-1635323647136.png

 

 

My data comes from multiple excel files sent by external parties via FTP and below is the qvd - 

FROM [lib://ROB_P_Functional_BackOfficexxx/DailyOverdraft.qvd]
(qvd);

 

And the excel file, I have attached it to you yesterday. 

Many thanks! 

 

NitinK7
Specialist
Specialist

seems all are good.

please try once to change from 

SET DateFormat='M/D/YYYY';   to SET DateFormat='D/M/YYYY';  at main sheet

and use same sciprt taht i sent earliear .

or  if possible then can you share your .qvd file with limited data (same as excel)