select "products".productline AS "products_line", SUM(Round(orderfact.totalprice/1000,1)) AS "orderfact_totalprice/1000" from PUBLIC.orderfact "orderfact", PUBLIC.products "products", PUBLIC.timeline "timeline" where "orderfact".productcode="products".productcode AND "orderfact".time_id="timeline".id AND  ("timeline".id <= NOW()) group by "products".productline order by "orderfact_totalprice/1000", "products_line"