BookmarkSubscribeRSS Feed
Steelers_In_DC
Barite | Level 11

I am trying to find multiples of ten between two variables.  The way the edit is written is:

 

CommittedBalance should not be multiple of 10 from prior quarter.  For example, the prior quarter was 10 and the current quarter was 100.  100 / 10 = 10.

 

I'm not sure how to check this.  Is there a way to manipulate the mod(current,prior) function for this?

 

Cheers,

 

Mark

3 REPLIES 3
Haikuo
Onyx | Level 15

Not sure I have fully understand your questions, is it like this?

 

if mod(current/prior,10)=0;

 

ballardw
Super User

The mod function with a result of 0 only would tell you that the value was A multiple of the prior, could be any .

 

If you have the values easily to compare then

if current = 10* prior then <what ever>;

 

would work.

PGStats
Opal | Level 21

I guess something like:

 

flag = CommittedBalance ne lag(CommittedBalance) and
	(mod(CommittedBalance / lag(CommittedBalance), 10) = 0 or 
	 mod(lag(CommittedBalance) / CommittedBalance, 10) = 0);
PG

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 719 views
  • 0 likes
  • 4 in conversation