Mismatched aggregation errors

Hi there,

I am getting an error of " [Mismatched aggregation. Custom aggregations can’t contain both aggregated “‘count’” and non-aggregated fields “count(distinct “metric B”)”, in any combination." I used this query for several of my calculated fields. They worked well until this error with “metric A.” Does is mean I need to use another syntax?

ifelse(dateDiff({date},now(),“YYYY”)=0 AND {date}<=now(),{metric A},0)

Thank you,
Jason

Hello @Jason_Wang!

Is MetricA a calculated field in your Quicksight analysis or is it from your dataset?

1 Like

It’s a traffic metric from a dataset.

Hey @Jason_Wang!

I recreated your calculated field for testing was able to save the calculation successfully.

Is your date field a string or is it a date data type?

Also, you could try creating your “Now()” into a parameter for today’s date (current date) and adding that to replace “Now()”.

1 Like

Hello @Jason_Wang !

Were you able to try my parameter workaround above or have you found another solution for this?

Hello @Jason_Wang !

It’s been a few days since we have heard from but would still like to help you find a solution. If we do not hear from you in 3 days this post will be archived.