exasol

sum last n days quantity using sql window function

二次信任 提交于 2021-02-11 13:36:56
问题 I am trying to create following logic in Alteryx and data is coming from Exasol database. Column “Sum_Qty_28_days“ should sum up the values of “Qty ” column for same article which falls under last 28 days. My sample data looks like: and I want following output: E.g. “Sum_Qty_28_days” value for “article” = ‘A’ and date = ‘’2019-10-8” is 8 because it is summing up the “Qty” values associated with dates (coming within previous 28 days) Which are: 2019-09-15 2019-10-05 2019-10-08 for “article” =