allegro / turnilo

Business intelligence, data exploration and visualization web application for Druid, formerly known as Swiv and Pivot
https://allegro.github.io/turnilo/
Apache License 2.0
729 stars 173 forks source link

Option to change business week #404

Open mihirtech opened 5 years ago

mihirtech commented 5 years ago

The business week definition differs from business to business. Few prefer it Sunday to Saturday, others prefer Monday to Sunday. This is needed for WoW analysis and all weekly view of metrics.

  1. Can we have this option in the dashboard for setting week as A. Monday to Sunday or B. Sunday to Saturday?
  2. As a fallback, if this is not possible in the dashboard, is it possible to change the default settings through a config file, which would apply to all users?
adrianmroz commented 5 years ago

You can easily select desired days in fixed time filter tab and time shift of one week will just that - shift by 7 days.

Only visible UI with "week start day" is inside date picker but I don't think it matters a lot. We could add that property to configuration of turnilo, but I think it's low priority.

Other case is when selecting relative "week" options are floored to (Monday, Sunday) range. That's how chronoshift works (https://github.com/implydata/chronoshift/blob/d2ed2c76aa0cd6ed25fe933bc731644fa7e99828/src/floor-shift-ceil/floor-shift-ceil.ts#L45) and I'm not sure if we can change something there easily.

mkuthan commented 5 years ago

@mihirtech - you could also define numeric dimension like "day of week" and use this dimension to simulate aggregation by any business week, e.g: 1 - Monday ... 7 - Sunday or 1 - Sunday .. 7 - Saturday.