Rushabh Sudame
Rushabh Sudame

Reputation: 474

Is there any way to get day from date in quicksight?

I am trying to get day from date field in quicksight.

Following is date format in quicksight: 2020-09-29T00:00:00.000Z

I want some function which will parse the date and give the day from this date. i.e., Tuesday

Upvotes: 4

Views: 6759

Answers (3)

Ali Eissa
Ali Eissa

Reputation: 1

here is how you can use ifelse

 ifelse(
     extract('WD', {day}) = 1, 'Sunday',
     extract('WD', {day}) = 2, 'Monday',
     extract('WD', {day}) = 3, 'Tuesday',
     extract('WD', {day}) = 4, 'Wednesday',
     extract('WD', {day}) = 5, 'Thursday',
     extract('WD', {day}) = 6, 'Friday',
     extract('WD', {day}) = 7, 'Saturday',
     'Invalid Date'
 )

Upvotes: 0

Scott Taylor
Scott Taylor

Reputation: 41

You could use formatDate to get the day of week as a string i.e. Monday ... formatDate({datetime}, 'E')

Upvotes: 4

OpusMagnum
OpusMagnum

Reputation: 96

In the QuickSight Dataset you can define a Calculated Field.

In your case, e.g. toString(extract('WD',{transaction_date})). This returns the day of the week as an integer, with Sunday as 1. If you need it as a word, you can further translate it with ifelse function.

Upvotes: 6

Related Questions