Max(date) not working

I am trying to use max(date_field) in a calculated field. but it is not returning any
value. Can someone help me figure this out?

Hi @Saisravan_Thummanepa - Welcome to AWS QuickSight community and thanks for posting the question. Can you please share the screenshot with some sample input and expected output. This will help you in guiding the right solution.

Regards - Sanjeeb

1 Like

Hi @Sanjeeb2022 , I provided screenshots please verify them

Hi @Saisravan_Thummanepa - I am not able to find any screenshot, please upload it again.

Regards - Sanjeeb

1 Like

MaxDate calculated function:
max({dataset_date})

Screenshot of visual with calculated

screenshot of visual with parameter used in calculated field:

Hi @Sanjeeb2022 ,
apologies for delay, It seems there was a glitch at my side, now I provided them in the reply thread please verify them.

1 Like

Hi @Saisravan_Thummanepa - Since the calculated field is a measure, please use it in value field, see the below screenshot

image

Regards - Sanjeeb

2 Likes

Okay, but when I am trying to use that date in another calculated field it is giving me following error, what is the correct way to use that function?

1 Like

Hi @Biswajit_1993 - Can you please help on this.

Regards - Sanjeeb

1 Like

Hi @Saisravan_Thummanepa

You will need to avoid have terms that are aggregated and non-aggregated in the calculation. You could use the maxOver and percentileOver functions instead as follows:

ifelse(
  {dataset_date} = maxOver({dataset_date}, [], PRE_AGG) 
    AND {Cost of GB Scanned} = percentileOver ( {Cost of GB Scanned}, 90 , [] , PRE_AGG),
  {Cost of GB Scanned},
  NULL
)
2 Likes

Thanks @darcoli ,
It is working now.

2 Likes

Thank you @darcoli for providing the solution.

Regards - Sanjeeb