|
He is my boss. What he really wants to know is the NET amount of the
pairs, whichever primary category_from/category_to I choose to
represent the net.
Susie
On Tue, Feb 15, 2011 at 8:44 PM, bbser 2009 <bbser2009@gmail.com> wrote:
> Susie
>
> If I were you, I would ask the guy who assigned this problem/task to me why
> preferring informationt-energy over energy-informationt.
> If he/she refuse to answer :) , then it is at my disposal
> and I would guess the criterion might hide in the values of amount, where
> you can see the less absolute value should be negated.
>
> -Max
>
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Chung
> Y. Li
> Sent: February-15-11 8:07 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: [SAS-L] Tricky data management
>
> I wonder if I have to do an internal data lookup, comparing the 1st
> record with the 2nd, 3rd, 4th record; compare the 2nd record with the
> 3rd, 4th record; compare the 3rd record with the 4th, 5th, 6th record,
> on and on. When I find the from/to reversal, then I put out the
> pairs.
>
> Susie
>
>
> On Tue, Feb 15, 2011 at 7:57 PM, Joe Matise <snoopy369@gmail.com> wrote:
>> You need to explain how to logically state which records are to be
>> reversed. If you can't do that, I don't think this problem can be
> solved...
>>
>> Is it just a matter of what's the first record you find in the data, that
>> defines which should be 'from'? Or do you have a dataset that lists which
>> should be 'from' and which should be 'to'?
>>
>> -Joe
>>
>> On Tue, Feb 15, 2011 at 6:48 PM, Chung Y. Li <li.chungying@gmail.com>
> wrote:
>>>
>>> That's the problem - I have a big dataset, and don't know how many
>>> pairs are just from/to reversal categories.
>>>
>>> I am quite stumped.
>>>
>>> Susie
>>>
>>> On Tue, Feb 15, 2011 at 7:37 PM, Sterling Paramore <gnilrets@gmail.com>
>>> wrote:
>>> > How do you define which one is on the left?
>>> >
>>> > How many categories do you have?
>>> >
>>> >
>>> >
>>> > On Tue, Feb 15, 2011 at 4:33 PM, Chung Y. Li <li.chungying@gmail.com>
>>> > wrote:
>>> >
>>> >> (Before)
>>> >> Category_from Category_to Amount
>>> >>
>>> >> InformationT Energy $50
>>> >> Energy InformationT $30
>>> >> Financials Materials $25
>>> >> Materials Financials $10
>>> >> ... ... ...
>>> >> (After)
>>> >> Category_from Category_to Amount
>>> >>
>>> >> InformationT Energy $50
>>> >> InformationT Energy -$30
>>> >> Financials Materials $25
>>> >> Financials Materials -$10
>>> >> ... ... ...
>>> >>
>>> >> Thanks.
>>> >> Susie
>>> >>
>>> >> > On Tue, Feb 15, 2011 at 7:19 PM, Reeza K <fkhurshed@hotmail.com>
>>> >> > wrote:
>>> >> >> Could you do something along the lines of :
>>> >> >>
>>> >> >> data want;
>>> >> >> set have;
>>> >> >> If category_from < category to then amount=-1*amount;
>>> >> >> temp=category_to;
>>> >> >> category_to=category_from;
>>> >> >> category_from=temp;
>>> >> >> run;
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >>> Date: Tue, 15 Feb 2011 18:52:43 -0500
>>> >> >>> From: li.chungying@GMAIL.COM
>>> >> >>> Subject: Tricky data management
>>> >> >>> To: SAS-L@LISTSERV.UGA.EDU
>>> >> >>>
>>> >> >>> Hello all,
>>> >> >>>
>>> >> >>> I have a dataset with values like this:
>>> >> >>>
>>> >> >>> Category_from Category_to Amount
>>> >> >>> A B $50
>>> >> >>> B A $30
>>> >> >>> ... ... ...
>>> >> >>>
>>> >> >>> I need to figure out a way to make the values this way:
>>> >> >>>
>>> >> >>> Category_from Category_to Amount
>>> >> >>> A B $50
>>> >> >>> A B -$30
>>> >> >>> ... ... ...
>>> >> >>>
>>> >> >>> Please help.
>>> >> >>>
>>> >> >>> Susie C Y Li
>>> >> >>> li.chungying@gmail.com
>>> >> >>
>>> >> >
>>> >>
>>> >
>>
>>
>
|