compute ChangeN;
_c4_ = (_c3_ - _c2_);
endcomp;
when _C3_ is 2
and column _C2_ 0
I want to see -2
but I am seeing in _c4_ 0
how to solve it.
@USHAKS wrote:
compute ChangeN;
_c4_ = (_c3_ - _c2_);
endcomp;
when _C3_ is 2
and column _C2_ 0
I want to see -2
but I am seeing in _c4_ 0
how to solve it.
How about
_c4_ = _c2_-_c3_;
compute ChangeN;
_c4_ = (_c3_ - _c2_);
endcomp;
C3 is 2020 sales
c2 is 2019 sales
when it is c3 is 13
and c2 is 15 I get -2
Assume C3 is 2020 sales and it is 0
C2 2019 sales 2
I do not get -2
thanks,
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.