Table of Contents | ||||
---|---|---|---|---|
|
...
How does it work in the search window?
Select Create column field in the search window toolbar, then select the Week of year operation.
If you only add the Timestamp argument, you will get the week of the year considering your current timezone. Optionally, you can specify a different time zone adding the Time zone argument to see the week of the year in the specified timezone. When assigning a time zone different to yours, pay special attention to the original timestamp of the event, as the result may imply a day shift in the time zone specified.
Argument | Data type | Description |
---|---|---|
Timestamp mandatory | timestamp | You can either select a |
field with that data type or introduce it manually. In case you want to introduce it, note that this value should be a date: Year-Month_Day Hour:Minute:Second.Millisecond (yyyy-MM-dd HH:mm:ss.SSS) → You can skip seconds and milliseconds. | ||||
Locale | string | You need a valid string format the app can recognize so it returns meaningful results. If you leave the field empty or introduce a value the app cannot recognize, the default Time Zone is UTC. You can use one of the following methods:
|
The data type of the new column field values will be integer and the values shown will be 01-5152, where 0 is where 1 is the first week of the year and 51 is and 52 is the last one. Since the count starts at 0, note that the result will be the week - 1 (for example, if the week of the year is 52, you will get 51).
Info |
---|
Be aware that timestamps taking place during summer will be affected in the time zones in which they set the clock forward during summer. For example, Europe/Madrid (CET-Central European Time), which is UTC+1, becomes UTC+2 during summertime and thus timestamps in August will be affected when using that time zone. Be also aware that summertime differs between the Northern and Southern Hemispheres. |
Example
In the demosiem.logtrust.ecommerceweb.dataactivity
table, we want to create a column field that indicates the week of the year of the dates in our eventdate column field. To do it, we will create a new column field using the Week of the year operation.
The arguments needed to create the new column field are:
Timestamp - eventdate columnfield
...
Click Create columnfield and you will see the following result:
...
Use the operator select
... as
... and add the operation syntax to create the new columnfield. These are the valid formats for the Day of the year operation:
...
You can copy the following LINQ script and try the above example on the demosiem.logtrust.ecommerceweb.dataactivity
table.
Code Block |
---|
from demosiem.logtrust.ecommerceweb.dataactivity select weekofyear(eventdate) as week_of_year |
...