Frequently Asked Question
Symptom
- Configure a Need4Viz Timeline to display data on weekly periods
Environment
- SAP BusinessObjects Business Intelligence Platform : all 4.2/4.3 Webi versions
- Need4Viz : from 2023.0.1
Resolution
To configure a Need4Viz Timeline to display data on weekly periods, you must follow two steps. The first one is the data preparation, the second one is the setting of the Timeline chart.
1. Data preparation in Webi (or in an ETL)
The N4V Timeline can only accept dates split into years, months, days... It cannot accept week numbers. So if you need to represent your data on weekley periods, you would prepare your data to fit the expected split.
If your data are stored day by day, the best way is to aggregate the data on the first day of each week (each monday for instance). This can be done through an ETL or directly in Webi by creating variables.
For istance, if you get in your query objects Input_Date (MM/DD/YYYY) and Measure, you need to create a variable in Webi to calculate the first day of the week relative to the Input Date.
The formula will be : =RelativeDate([Date Jour];1-DayNumberOfWeek([Date Jour]);DayPeriod)
Then you can create 3 additional variables to get the Year, Month number and Day number of these calculated date :
Now you can create your Timeline with the variables created before :
2. Setting of the Timeline
Now for the second step, edit the Timeline global settings
X-Axis setting
You can fix the X-Axis to fit weekly period through the "Fixed format of axis datetime". You can use
- %W : A numeric representation of the week of the year, starting with the first Monday as the first week
Ex. : 46 (for the 46th week of the year beginning with a Monday) - %V : ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week
Ex. : 01 through 53 (where 53 accounts for an overlapping week) - %G : four digit representation of the year going by ISO-8601:1988 standards
Ex. : 2008 for the week of January 3, 2009
Now the X-axis is correctly formated :
Tooltip setting
You can also format the format of the tooltip. Specify the Week period format (use the same %W, %V and/or %V options) :
Now the tooltip is correctly formated :