Calendar package

Model that implements classes that makes aggregation (for statistics for example) easy.

It follows a common pattern with dimensions from data analysis. By prepopulating the database with days, months, years, weeks etc, you can easily (and efficiently) find data to present in a diagram or table.

Calender model diagram.png

CalendarPackage.modlr

There are a lot of methods that create a "web" of navigation between all entities in this model.

To create the data structure, start by using an action to create the years you want.

Then with that, you call FixupDatabase to create months and days of the calender.

Weeks is a bit special. Week definitions vary in different parts of the world. Therefore the WeekDefinition class sets the first day of the week and weeks are then generated based on that.

You can also define Saturday and Sunday (for example) as the "days off" every week.

Use the country setting to define the default week definition for your users.

There is also a lot of helper function to find next/previous day, week or months or calculate time between them.

Integers called Ordinals are used to have a stable way to calculate how far apart objects are in time.

Use the methods in SysSingleton to quickly find the Day for a given date when you link new or existing data to the structure.

This page was edited 46 days ago on 03/26/2024. What links here