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

Link Dates from different source to use one filter for both

Hello 

I have a problem that I cannot see a solution for.

I have different sources some are containing a date, in different formats;

01.2019 = Januar in 2019

and

01/01/2019 = 1st of Januar in 2019

I display values from both sources in a bar chart, but I would like to have only on date filter plane for the sources.

Filter plane 1 = Month

Filter plane 2 = Year

Filter plane 1 and 2 shall then display a combination of the dates from both sources, if a month is missing then it is left out and the same with a year.

How do I make this work?

 

Thanks.

6 Replies
Channa
Specialist III
Specialist III

try add these 2 columns in all 3 sources and join ur tables with master calendar and take filter from master calendar

Month(date)

year(date)

 

try to have 

 

how to create master calendar you have some script below

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

 

Channa
KML
Contributor
Contributor
Author

Hello Channa

I cannot make it work with the 01.2019 date format - could the format really be a problem?

In addition, will it not be a problem if I link the two dates together when i already have a link between the customer ID's?

 

Thanks for the help.

jonathandienst
Partner - Champion III
Partner - Champion III

>>I cannot make it work with the 01.2019 date format - could the format really be a problem?

Well perhaps. Are you interpreting this as a date, or is Sense reading this as text? You need something like this in script:

Date(Date#(myDateField, 'MM.yyyy')) as DateField,

>>In addition, will it not be a problem if I link the two dates together when i already have a link between the customer ID's?

Again, perhaps, but this is a data model design question. We would need a lot more information to provide useful advice. There is nothing wrong in principle with correctly designed and relevant composite keys (aka synthetic keys). This may or may not be the case with your model.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Channa
Specialist III
Specialist III

Convert those in to date format

date(date#(urfield,'MM.YYY'),'MM-YY')

Channa
KML
Contributor
Contributor
Author

Hello Jontydkpi

Well attached is the current overview.

My goal is to have the dates from different field to work as one when I apply a date filter.
I hope this helps to see what I mean.

KML
Contributor
Contributor
Author

Thanks Channa, that seems to work for my date format - but with a small change;

Date(Date#([Month], 'MM.YYYY'),'MM-YYYY')