Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Tutorial - Using Common Date Dimensions and Shared Calendars

The question of aggregating multiple dates into a common date dimension like Month comes up frequently on this forum. I've posted a QVW tutorial on my website that shows how I typicaly handle the issue.

http://qlikviewcookbook.com/recipes/download-info/tutorial-using-common-date-dimensions

The QVW is not Personal Edition enabled.

-Rob

Message was edited by: Rob Wunderlich Link updated

65 Replies
Not applicable

Pls refer the datamodel,  both the date cols. are in database table, have tried to club both in seperate table named as Duedate

export.png

hic
Former Employee
Former Employee

You need to solve this by creating a link between the common date and the FILE_NO, so that a FILE_NO can have several dates. I would make a bridge table like in the following picture

Bridge Table.png

where each line corresponds to either an Action date, or a Due date, or some other date. Then it is just a matter of linking this to the rest of the data through FILE_NO:

CommonDate.png

I am not sure that your current COMMON_INFO table does the above.

HIC

Not applicable

Thanks Henric for the help, will work on it i have used the traditional way of common calender, will let u know the results in short time,

also need a small favour,

hw to manage the Tilldate concept, whn user selects Duedate, he shld get the data in the chart till that date selected.

Thanks again

hic
Former Employee
Former Employee

Set analysis. E.g.

Sum({$<OrderDate={"<=$(=Max(Duedate))"}>} Sales)

HIC

Not applicable

Hi Henric,

I can understand the link table consept, and  theriticalley it should work. But if you look at this this model, why the month field in Table 3 was not connecting to the rest of the data in Table 1 and Table 2.

Thanks for your help.

hic
Former Employee
Former Employee

Because your data isn't matching. If I select all values in Key1, then all values in Key2 and Key3 are excluded. And the same is true whichever key I use.

HIC

Data model 20130618.png

Not applicable

so if i understand, the key data need to be match to link the data across the objects. Not the data element like the one on this picture. If that is correct, what would be the solution on how to connect this data.

linkTables.PNG

darren_dixon
Contributor III
Contributor III

Hi,

Note - I've attached my QVW of the problem


I am trying to use the common calendar example linked here:

http://community.qlik.com/thread/66717

My problem is that the appointments are not adding to the table.

The total number of appointments should be 236779

The actual figures should look like this:

MonthAppointments
Total236779
Dec13519
Aug13698
Sep14630
Feb16087
Nov17336
Mar17494
Jan18179
Oct18240
Jul18791
Jun26561
Apr29237
May33007

When I change the date to date(ActualStartDate) i get the following:

Monthsum(
{<DateType={Order}>}
OrderCounter)
sum(
{<DateType={Shipment}>}
ShipmentCounter)
sum(
{<DateType={Order}>}
Quantity)
AppointmentsTravel Time
Total6116212367791959:03:00
Jan2120300:00:00
Feb1310300:00:00
Mar3031500:00:00
Apr01000:00:00
Jun01000:00:00
Jul00001959:03:00
Aug01000:00:00
Sep01000:00:00
Oct01000:00:00
Nov01000:00:00
Dec01000:00:00
-0002367790:00:00

When I change the date to Date(Floor(ActualStartDate) I get the following:

Monthsum(
{<DateType={Order}>}
OrderCounter)
sum(
{<DateType={Shipment}>}
ShipmentCounter)
sum(
{<DateType={Order}>}
Quantity)
AppointmentsTravel Time
Total6116212367791959:03:00
Jan212032194810:00:00
Feb131032197500:00:00
Mar303152332380:00:00
Apr0102309570:00:00
May0002310430:00:00
Jun0102271180:00:00
Jul0002333091959:03:00
Aug0102215310:00:00
Sep0102224190:00:00
Oct0102231570:00:00
Nov0102263790:00:00
Dec0102220790:00:00

Thanks,

Darren

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP
Author

You appear ro have some expressions mixed in from the example as well as your data. Are there really related? Please post a sample QVW or your table viewer picture.

In your last comment, it appears that your ActualStartDate field is a timestamp and you need to floor() it to get the integer portion. to make a linkage to the Calendar. This is correct. I would have to see your data model to explan the double counting, but I wouuld start by removeing the sameple expressions from the table.

-Rob

darren_dixon
Contributor III
Contributor III

Hi Rob,


I posted this earlier today. I'm unsure how to attached the QVW to this post so I've included it here: http://community.qlik.com/thread/87958?tstart=0