Skip to content

How to group this table properly?

Here’s my dataset with expected out. But I am having issues doing it. Also, I attached the query I created and the output is not correct. could you please point me to where my mistake is? DROP TABLE …

SQL window function with date filter

Looking to do a LAG/LAST_VALUE/MAGIC window function on a table which somehow needs to include a date filter (as in how far back it should go). I’m trying to get the value as of 7 days ago onto every …