windowSum unexpected behaviour

I am trying to use windowSum in a calculated field to pull the sum(sales) for the previous valuation_date. When I add this to my table, I see the calculated field = sum(sales) for the same valuation_date, not the one prior.

windowSum
(
sum({sales}),
[{valuation_date} DESC],
0,
1, [{valuation_date}]
)

Hi @akshai

Welcome to the Quick Sight Community!

To pull the sum of sales for the previous date, please use the following corrected formula. This will calculate the sum of sales for the previous date in descending order by OrderDate.

Example: (Syntax may vary - Adjust the field name from your dataset)

windowSum
(
  sum(Sales),
  [OrderDate DESC],
  0,
  1
)

Please refer the below documentation this might be helpful for you.

Hi @akshai,
It’s been awhile since we last heard from you, did you have any additional questions regarding your initial topic?

If we do not hear back within the next 3 business days, I’ll go ahead and close out this topic.

Thank you!

Hi @akshai,
Since we haven’t heard back, I’ll close out this topic. However, if you have any additional questions, feel free to create a new post in the community and link this discussion for relevant information if needed.

Thank you!