SQL daily value (today value - yesterday value)
The data don't fit your wanted resuLt, so i had to change the date
Schema (SQLite v3.30)
CREATE TABLE table1 (
  `ID` INTEGER,
  `Quantity` INTEGER,
  `DATE` DATE
);

INSERT INTO table1
  (`ID`, `Quantity`, `DATE`)
VALUES
  ('1', '40', '2020/10/10'),
  ('2',  '0', '2020/10/11'),
  ('3', '10', '2020/10/12');


Query #1
SELECT 
*,
    Quantity - LAG ( Quantity, 1, 0 ) OVER ( 
        ORDER BY `DATE` 
    ) PreviousYearTotal  
    FROM table1;

| ID  | Quantity | DATE       | PreviousYearTotal |
| --- | -------- | ---------- | ----------------- |
| 1   | 40       | 2020/10/10 | 40                |
| 2   | 0        | 2020/10/11 | -40               |
| 3   | 10       | 2020/10/12 | 10                |


View on DB Fiddle