I tried a different aproach by putting the @query content in a temporary table , on a Pre-SQL command , and then, selecting all the info into the temporary table.
Here the problem was that in reportico we aren't able to use (*) operator to get all columns
SET @column_alias1 := NOW() - INTERVAL 1 WEEK;
SET @column_alias2 := NOW() - INTERVAL 2 WEEK;
SET @query := CONCAT('CREATE TEMPORARY TABLE test_table_x SELECT SUM(1) AS `', @column_alias1, '`, SUM(2) AS `', @column_alias2, '` ');
PREPARE dynamic_statement FROM @query;
and in the main SQL Query:
SELECT * FROM test_table_x;