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.

Posted in reply to chittamsri1_gmail_com

proc sql;

select

product,

sum(amount) as transaction_amount

from

     work.have

where

     DateAdded >= date()-7

group by product;

quit;

Super User
Posts: 10,018

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.

Posted in reply to chittamsri1_gmail_com

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

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