I'm trying to create a view table and would like to custom one of my field name based on latest date. For example like this:
SELECT SUM(total_settlement) AS CONCAT('total_settlement_', CAST(DATE_TRUNC(CURRENT_DATE(), WEEK) AS STRING))
FROM `xxx.dataset.table_source`
WHERE transaction_date BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY) AND CURRENT_DATE()
However, I got an error in that field-aliasing part. Is it possible to do this?
Thank you