Help using Base SAS procedures

1. We have a data set where every day new data will be appended to the data set. He wants the last week total transaction amount by the product, however, it should be dynamic.

Reply
Occasional Contributor
Posts: 12

1. We have a data set where every day new data will be appended to the data set. He wants the last week total transaction amount by the product, however, it should be dynamic.

1. We have a data set where every day new data will be appended to the data set. He wants the last week total transaction amount by the product, however, it should be dynamic.

Super Contributor
Posts: 578

Re: 1. We have a data set where every day new data will be appended to the data set. He wants the last week total transaction amount by the product, however, it should be dynamic.

proc sql;

select

product,

sum(amount) as transaction_amount

from

     work.have

where

     DateAdded >= date()-7

group by product;

quit;

Super User
Posts: 9,682

Re: 1. We have a data set where every day new data will be appended to the data set. He wants the last week total transaction amount by the product, however, it should be dynamic.

You can use %sysfunc(today()) to get last week number and get the amount of transaction .

Ask a Question
Discussion stats
  • 2 replies
  • 169 views
  • 1 like
  • 3 in conversation