i need to load data into a table and use that information to create new columns. For example, I am adding to a table the name of products a customer orders, the date of the order, the invoice and timestamp. I need to create a report where i have several calculated columns such as : last 4 week average for a product, last 7 days last year avg etc.... I wanted to use the in db formula tool to write something similar to this sql query :
SELECT product_type,Count(product)FROM table
WHERE order_dt <= Current_Date -1 AND order_dt>= current_date-28
GROUP BY product_type
can anyone help me do this?