Showing last week data in the visual

Hello,

Need help with this scenario, I have multiple datasets through which I created visuals. Am stuck in place where I need to show a metric whose value of the last week for that time period should be captured, I have other metrics that should not be disturbed .

Example from the below table if you see, its a table for sales and quantity distributed across weeks, this table also has month and Quarter. So when I group the data to Month or Quarter, it should sum the value of Quantity but for the metric Sale alone, it should the sum of sales for the last week for that period.

Hello @ganeshng

Can you try sumOver({Quantity}, [{Date}], PRE_AGG)?

For {Date} you will want to truncate your date field to week and then apply that to this calculation.