Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Quicksight - MAX Data calculation but display date

How Can I MAX a date but display it on the Analysis/Dashboard?

I am aware I can use the following to max a date:

extract('YYYY',OrderCreatedDate) * 365 + extract('MM',OrderCreatedDate) * 31 + extract('DD',OrderCreatedDate)

But how I can put it back into a Date Format to display to users, I want to display the "last" order date the customer placed.

Thanks

like image 500
n34_panda Avatar asked Oct 16 '22 05:10

n34_panda


1 Answers

Based on my attempts it's not possible to calculate this as a single value except for tables and pivot tables. You can use the rank() function in a table or pivot table to calculate the most recent date and then filter on rank = 1 for the most recent date.

Alternatively, to achieve similar functionality, you can use a relative date filter and set dates relative to the current date time or from a parameter. For example, if you are ingesting data on a daily basis you can filter on 'this day' or 'X days' relative to the parameter.

The last resort would be to do a calculation in SQL before ingesting the data into QuickSight. You could create a view with a MAX() calculation and then join this to your dataset as a boolean column so you could filter on this within your visuals.

like image 56
andrew citera Avatar answered Oct 19 '22 00:10

andrew citera