Schema (PostgreSQL v12)
CREATE TABLE test (ts timestamp, value1 float8, value2 float8);
insert into test values
('2017-01-01', 1, 1),
('2017-01-02', 1, null),
('2017-01-03', 1, 1),
('2017-01-04', NULL, 100),
('2017-01-05', 1, 1),