How it works…

The Declare function is used to create the Calendar definition and tag it to $date. The Calendar definition is then used to derive related dimensions such as Year, Month, Week, and so on. The first_month_of_year parameter indicates what the first month of the year should be. It contains comma-separated values, but it is optional and can be skipped if needed. Next, we define the fields we want to generate in the Calendar table. $1 represents the data field from which the date field will be generated, which is InvoiceDate in our case. When the field definition is used, a comma-separated list of fields is generated. The Derive function is used in order to generate the derived fields such as Year, Month, and so on from the InvoiceDate field. The groups are defined at the end of the script that creates a drilldown group for Year, Month, and Date.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset