windowAvg before viz filters?

Hi all, I am trying to use the windowAvg() function but do it prior to the viz filters. For example, I have a table that I want all dates to get an even 30 days to calculate the 30-day trailing average. Currently the windowAvg() only has access to data β€œin” the viz. Meaning, the min edges of the table/time-series graph do not have access to the 30-days prior data because they are on the edge.

This question was asked in Feb 2024 but the community just suggested doing this calculation in the SQL prior to bringing in the dataset, with the solution author saying β€œI am unable to build a work-around with the calculated fields.”

I have seen others suggest that we can use a denserank() function and use that as a filter rather than a calendar_date field. This seems like another workaround. If it truly works, I would love some assistance from the experts here to show how that works. A requirement of mine is that we can have customer start_date and end_date values for the viz. So I am not sure how that would play into the denserank() function as well.

Otherwise, I would like to ask the Quicksight team if there is a possibility of getting a PRE_FILTER calculation level parameter added to the windowAvg() function.

Hello @jbarokas, due to the limitations with the windowAvg aggregation, and it not containing an aggregation level option like LAC-W aggregations like sumOver or distinctCountOver, this currently is not possible.

I suppose the only possible work-around would be to create the windowAvg calculated field, then filter out values in an ifelse statement with parameter values. That could possibly provide you with a solution similar to what you are looking for.

I can also tag this topic as a feature request since the functionality is currently not available in QuickSight. Let me know if you have any remaining questions, otherwise I can archive this topic for the support team. Thank you!

Thanks! Can you please create a feature request flag and note that this has been requested for multiple years now a few different times? Thanks!

1 Like

Hello @jbarokas, I have tagged this as a feature request. Thank you!