Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
I want to add a filter pane date field which will be connected to 2 (or more) different date fields from 2 different tables.
I was thinking of creating a third table using a Data Load Editor script including the 2 tables' date field values and using the new table field in filter pane.
Is there any other more optimal way to implement the above scenario?
Thanks.
Hi there,
I'm afraid that associating these date fields in a separate link table may cause accidental linking, synthetic keys and circular references. The best data modeling solution for these issues is what's called a "Canonical Date" - if you Google it, you should find several blog articles that describe it.
Another solution, which I consider a bit risky, is to create a separate Calendar table that is not associated with other date fields, as a "data island". Here you need to be careful not to cause a Cartesian Join. The ONLY acceptable form of using this island is within Set Analysis folders, like this for example:
sum( {<OrderDate = P(CalendarDate)>} Value)
sum( {<ShipDate = P(CalendarDate)>} Value)
sum( {<InvoiceDate = P(CalendarDate)>} Value)
This way, you can make selections on the Calendar fields and then tie all other dates to it using Set Analysis. You just need to be careful not to compare these dates in any other way. For example, this formula:
sum( IF(OrderDate = CalendarDate, Value))
would cause a Cartesian Join between your fact table and the island calendar.
To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!