Hi,
I am having the following variables as
pr_num,week,product,total_rxn,total_rx,sbu,terri_state and district.
I want to group the product by
terri_state ,total_rxn,total_rx,district for the current month &
previous month(here the date format is like this ddmmyyyy.
I need to develop a report for the current month & previous month.
Can anyone help me in this regard.
Regards,
Sid
|
|
0
|
|
|
|
Reply
|
msiddu2000 (20)
|
12/25/2009 11:30:51 AM |
|
Sid,
I think you will be more likely to get a response if you provide:
1. a sample dataset, in the form of a datastep
2. code that you tried to produce what you want would be nice
3. how you want the resulting report to look like, given the sample
data set
Art
----------
On Dec 25, 6:30 am, msiddu2000 <msiddu2...@gmail.com> wrote:
> Hi,
>
> I am having the following variables as
> pr_num,week,product,total_rxn,total_rx,sbu,terri_state and district.
> I want to group the product by
> terri_state ,total_rxn,total_rx,district for the current month &
> previous month(here the date format is like this ddmmyyyy.
> I need to develop a report for the current month & previous month.
> Can anyone help me in this regard.
>
> Regards,
> Sid
|
|
0
|
|
|
|
Reply
|
art297
|
12/26/2009 4:39:54 PM
|
|
its a simple thing to get the current month with the month function. You
can form a where clause on a SAS date variable like
where month(datevar) = month(today());
The previous month might be a problem if you are in january. There are
several ways to get it. One is
month(intnx("month",date,-1)) = month(intnx("month",today(),-1))
Gerhard
On Sat, 26 Dec 2009 08:39:54 -0800, Arthur Tabachneck
<art297@NETSCAPE.NET> wrote:
>Sid,
>
>I think you will be more likely to get a response if you provide:
>
>1. a sample dataset, in the form of a datastep
>2. code that you tried to produce what you want would be nice
>3. how you want the resulting report to look like, given the sample
>data set
>
>Art
>----------
>On Dec 25, 6:30 am, msiddu2000 <msiddu2...@gmail.com> wrote:
>> Hi,
>>
>> I am having the following variables as
>> pr_num,week,product,total_rxn,total_rx,sbu,terri_state and district.
>> I want to group the product by
>> terri_state ,total_rxn,total_rx,district for the current month &
>> previous month(here the date format is like this ddmmyyyy.
>> I need to develop a report for the current month & previous month.
>> Can anyone help me in this regard.
>>
>> Regards,
>> Sid
|
|
0
|
|
|
|
Reply
|
gerhard.hellriegel (2531)
|
12/26/2009 8:50:01 PM
|
|
hi,
for the next example dataset:
data test;
input total_sales country $ date;
format date ddmmyy10.;
cards;
10000 FR 18180
12300 UK 18213
2700 UK 18229
11000 SP 18255
5000 PT 18259
;
run;
you can filter the last 2 months with the next macro ( and forget to
rewrite the filter for next monthly periods):
%macro bimonthly;
%global begin end output;
%let begin=%sysfunc(intnx(month, "&SYSDATE9."d, -1));
%let end=%eval(%sysfunc(intnx(month, "&SYSDATE9."d, 1))-1);
%let output=%sysfunc(catx(_,%sysfunc(putn(&begin,MONYY5.)),%sysfunc(putn(&end,MONYY5.))));
%mend;
%bimonthly;
proc summary data=test (where=(&begin <= date <=&end)) nway;
class country;
var total_sales;
output out=&output (drop=_:) sum()=;
run;
Daniel Fernandez
Barcelona.
2009/12/26 Arthur Tabachneck <art297@netscape.net>:
> Sid,
>
> I think you will be more likely to get a response if you provide:
>
> 1. a sample dataset, in the form of a datastep
> 2. code that you tried to produce what you want would be nice
> 3. how you want the resulting report to look like, given the sample
> data set
>
> Art
> ----------
> On Dec 25, 6:30 am, msiddu2000 <msiddu2...@gmail.com> wrote:
>> Hi,
>>
>> I am having the following variables as
>> pr_num,week,product,total_rxn,total_rx,sbu,terri_state and district.
>> I want to group the product by
>> terri_state ,total_rxn,total_rx,district for the current month &
>> previous month(here the date format is like this ddmmyyyy.
>> I need to develop a report for the current month & previous month.
>> Can anyone help me in this regard.
>>
>> Regards,
>> Sid
>
|
|
0
|
|
|
|
Reply
|
fdezdan (222)
|
12/31/2009 10:59:28 AM
|
|
|
3 Replies
241 Views
(page loaded in 0.064 seconds)
Similiar Articles: selecting the first 3 working days of a month - comp.soft-sys ...... selecting the first 3 working days of a month - comp.soft-sys ..... Hi All I have a <SELECT> for the month (1 .. 12) and a <SELECT ... The first will have the current ... proc surveyreg Vs proc mixed - comp.soft-sys.sasHi everyone. I've been analyzing my current data by proc mixed as a 3-level multilevel random intercept model. But I wonder whether proc surveyreg... Year to date calculation in OLAP cube - comp.soft-sys.sas ...I have fiscal year and fiscal month as dimensions in my OLAP cube as well as revenue as a measure. I would like to have a rolling total by fiscal y... Choosing FPGAs: Xilinx vs Altera vs Actel vs Lattice - comp.arch ...... you will find a lot more similarities between X and A ... All of the newer (read supported by current software ... earnings conference call from Altera last month, I think ... Solaris 8 xntpd vs ntpd? - comp.protocols.time.ntpThe reason for using a current version, rather the old, or very old snapshot, is ... If memory serves me, it has been at least 18 months now. Perhaps in four or five ... clock stops, U5/10 Solaris 8 - comp.unix.solaris[crossposted comp.unix.solaris,comp.sys.sun.hardware] A couple times a month the clock on one of our systems stops. Actually it gets stuck in a 3 se... Conditional Formatting and Repetion Fields - comp.databases ...FMP 10: Nurserey want's a plan showing what room gets cleaned when. I have a list view with the rooms from top to bottom. The want the days of the month from left to ... Month To Date Calculation - comp.soft-sys.sasHello Group, How can I achieve the Month To Date and Year To ... in my OLAP cube as well as revenue as a measure. I would like to have a rolling total ... FeatureManager tree: Features vs. Dependencies - comp.cad ...Unfortunately, it has too many bugs that prevent me from rolling it out into the ... Furthering things, my maintenance was due a couple of months back and I did not ... select .. where date between curdate() and 'Sep 30' - comp ...Hi All I have a <SELECT> for the month (1 .. 12) and a <SELECT ... The first will have the current date, whilst the ... be given hour:minute, if 3 fields are ... 30-day ... Current month vs Rolling month - sas - Mofeel Groupssas, Current month vs Rolling month . comp.soft-sys.sas - The SAS statistics package. What is the definition of a rolling 12 months in terms of sick payRolling 12 months is simply saying, "From any given month, go back 12 months and total it up." So, a "rolling 12 months" for September '09 would be the total between ... 7/16/2012 7:38:28 PM
|