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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
MaryanVegaC
Contributor II
Contributor II

Several data set with date fields

Hello,

I have been working in a app with several data sets, and the majority of then come with date fields. I have been working with some of then to build my measures, but when the time comes to combine different fields from different data sets and I tried to visualize in a table my measures by a date dimension, some of then don`t work. Someone could advice how to address this issue.

 

Labels (3)
3 Replies
QFabian
MVP
MVP

Hi @MaryanVegaC , here some tips that i use to deal with dates from different sources and formats.

1.- Check the initial variables in Main tab script, maybe you need 'MM-DD-YYYY' or 'DD/MM/YYYY'. Check against your date fields.

QFabian_0-1668104849355.png

 

2.- Check every Date field, just puting them as filters on screen :

Example : 

QFabian_1-1668104968765.png

 

As you can see, when the text of the date is at the right side of the filter, it means that is a number, otherwise, qlik couldnt interpretate as date, or as number.

QFabian_2-1668105039414.png

Then you can make the neccesary changes to correct that, in this case, i change some dates by reposisionating parts, or replacing '-' by '/'. There are going to be different many cases in different escenarios, example script:

 

Date1:
Load * INLINE [
Date1
1/1/2021
];

Date2:
Load * INLINE [
Date2
30/12/2021
];

Date3:
Load * INLINE [
Date3
5-25-2021
];

Dates:
Load
'Date1' as Source,
Date1 as Date
Resident Date1;

Load
'Date2' as Source,
date(makedate(subfield(Date2, '/', 3), subfield(Date2, '/', 2), subfield(Date2, '/', 1))) as Date
Resident Date2;

Load
'Date3' as Source,
replace(Date3, '-', '/') as Date
Resident Date3;

Result :

QFabian_3-1668106029600.png

 

Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
MaryanVegaC
Contributor II
Contributor II
Author

Thank you. Really good tips!

Vishal_Gupta
Partner - Creator
Partner - Creator

@MaryanVegaC in scenario such as this, I feel it's better to go ahead and unify date formats of all date fields.

But before that you should definitely carry the steps mentioned by @QFabian .

If a post helps to resolve your issue, please accept it as a SOLUTION and leave a LIKE!