If the rows are coming from a database, the last (or next) known value can be obtained by the SELECT statement:
Code:
SELECT
date,
product,
amount,
( SELECT amount FROM sales WHERE product = s.product AND amount IS NOT NULL AND date > s.date ORDER BY date LIMIT 1) AS next_amount,
( SELECT amount FROM sales WHERE product = s.product AND amount IS NOT NULL AND date < s.date ORDER BY date DESC LIMIT 1) AS prev_amount
FROM sales s
This way it doesn't matter, if the values for consecutive dates are missing.

Originally Posted by
Bergtroll
What I try to solve is to fill gaps (null values) of a total amount fact in a timeline with the values from the last predecessor or successor date entry, depending on which is bigger.
And you still call it a fact?