Overview
Application Scenarios
After preparing the data table, you may need to group and display the date fields in different ways and formats.
For example, if you want to group date fields by year, Year-Month, and Year Month Day, there are three formats for displaying.
Functions
l Click the dropdown box in the analysis section to modify the grouping of date fields. There are multiple classification ways: Year Month Day, Number of weeks in year, Year-Month, Year Quarter, year, Quarter, Month, Month Day, Weeks, Week, Sun, Hour, Minute, Second, Year Month Day Hour, Year Month Day Hour Minute, Year Month Day Hour Minute Second.
l Click the dropdown in the analysis column to modify the time format. There are three time formats: yyyy-MM-dd, yyyy year MM month dd day, and yyy/MM/dd.
Setting Date Grouping
Use the sample data provided in the demo Order Detail Table.
Setting Date Grouping
In the Component editing interface, you can select the Order Date field and drag it into the Dimensions bar, and select the Order Amount field and drag it into the Indicators bar.
There are 17 ways to group dates: Year Month Day, Number of weeks in year, Year-Month, Year Quarter, year, Quarter, Month, Month Day, Weeks, Week, Sun, Hour, Minute, Second, Year Month Day Hour, Year Month Day Hour Minute, Year Month Day Hour Minute Second. You can switch the display format of the date for any grouping method of dates.
Number of Weeks in a Year and Weeks
l Number of weeks in year
The week starts on Monday: The first week of the year is the one that includes the first Thursday of the year, which may span two calendar years.
The week starts on Sunday: The first week of the year is the one that includes the first Wednesday of the year, which may span two calendar years.
l Weeks
The week begins on Monday and ends on Sunday. If January 1st is not Monday, the first week is the one that begins from January 1st to the first Sunday of that month (within the same year). The second week begins on the following Monday.
The week begins on Sunday and ends on Saturday. If January 1st is not Sunday, the first week is the one that begins from January 1st to the first Sunday of that month (within the same year). The second week begins on the following Sunday.
Take 2021/01/03 as an example:
If you set Monday as the first day of the week in the platform:
Date | 2021-01-03 | Description | 2021-01-04 | 2021-01-05 |
Number of weeks in year | 2020-53 | The first Thursday of 2021 is January 7th, so the first week is from January 4th to 10th. | 2021-01 | 2021-01 |
Weeks | 1 | January 1st is not Monday, so the first week is from January 1st to 3rd. | 2 | 2 |
If you set Sunday as the first day of the week in the platform:
Date | 2021-01-03 | Description | 2021-01-04 | 2021-01-05 |
Number of weeks in year | 2021-01 | The first Thursday of 2021 is January 7th, so the first week is from January 3rd to 9th. | 2021-01 | 2021-01 |
Weeks | 2 | January 1st is not Sunday, so the first week is from January 1st to 2nd and the second week is from January 3rd to 9th. | 2 | 2 |
Setting Time Format
If you want to set the time format of Order Date as 1990-01-01(yyyy-MM-dd), select the order date field in Dimensions and choose yyyy-MM-dd in Time Format in the dropdown list.
Setting Display Name
You can either select Set Display Name or double-click on the Order Date field to modify it.