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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date issue

Sorry guys for this simple issue.

I have 2 txt file where the date fields have different format. Itlooks like

- 12/10/10 in the first one

- "2010/10/12 00:00:00" in the second

I'd like to concatenate both files with a unique date fields in 'DD/MM/YYYY' format.

How to achieve this ?

JJ

4 Replies
brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi JJ,

you have to use the floor function:

First date: Load Date#(Datefield1,'DD/MM/YY') As DateKey, ...

Second date: Load Floor(Date#(Datefield2,'YYYY/MM/DD') As DateKey, ...

Not applicable
Author

Hi Martina

Don't work !

Here a sample of my data(for the second)

"Code Entite comptable" "Date Comptable" "Nombre de lots"
"010040" "2010/10/11 00:00:00" "180"
"010040" "2010/10/12 00:00:00" "269"
"010040" "2010/10/13 00:00:00" "333"
"010040" "2010/10/14 00:00:00" "258"
"010040" "2010/10/15 00:00:00" "239"
"010040" "2010/10/16 00:00:00" "124"

Maybe another idea ?

JJ

brenner_martina
Partner - Specialist II
Partner - Specialist II

Hi JJ,

This works:

Data:
LOAD * INLINE [
"Code Entite comptable", "Date Comptable", "Nombre de lots"
010040, 2010/10/11 00:00:00, 180
010040, 2010/10/12 00:00:00, 269
010040, 2010/10/13 00:00:00, 333
010040, 2010/10/14 00:00:00, 258
010040, 2010/10/15 00:00:00, 239
010040, 2010/10/16 00:00:00, 124
];

Left Join (Data)
Load *,
Floor(Date#("Date Comptable",'YYYY/MM/DD hh:mm:ss')) As DateNew
Resident Data;

Not applicable
Author

Yep Martina ! I forgot hh:mm:ss.

Thanks for your time

JJ