Reputation: 21
I need to display Week as number in AWS QuickSight. There is no WEEK function under extract. truncDate has WK, but this function does not result as Week_number: truncDate('WK',{date}). Any ideas?
Upvotes: 1
Views: 14156
Reputation: 595
Quicksight now has WEEKNUM
function to extract week number from the date. Here is a sample implementation
WEEKNUM(parseDate({Your_Date_Field}, 'yyyy-MM-dd'))
Upvotes: -1
Reputation: 326
Create a calculated field
dateDiff(truncDate('YYYY', mydate), mydate, 'WK')
Upvotes: 3
Reputation: 11
As explained before, you can do what you are looking for by going to the Field Wells -> Datetime field (X or Y axis) -> Format -> More formatting Options -> Custom
.
You can use W
or w
, the first will give you the week number corresponding to the current week, while the latter may offset you by a week. For instance, using an aggregation by DAY, the date of 14-Jun-2021
gives me Week 25
when I use custom w
and Week 24
when I choose W
.
Upvotes: 1
Reputation: 13
If you want year and week combination then you can use customer format option and type 'Yw' (this will return 202121 - 2021 year and 21 week).
Upvotes: -1
Reputation: 41
In the field wells click the dropdown for your date field, mouse over Format and select 'More formatting options'. On the left panel in the Custom dropdown type 'w'.
Upvotes: 4