DATA Step, Macro, Functions and more

QC Syntax question, mulitples of ten

Reply
Valued Guide
Posts: 858

QC Syntax question, mulitples of ten

[ Edited ]

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

Respected Advisor
Posts: 3,124

Re: QC Syntax question, mulitples of ten

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

 

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

 

Super User
Posts: 10,466

Re: QC Syntax question, mulitples of ten

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.

Respected Advisor
Posts: 4,641

Re: QC Syntax question, mulitples of ten

I guess something like:

 

flag = CommittedBalance ne lag(CommittedBalance) and
	(mod(CommittedBalance / lag(CommittedBalance), 10) = 0 or 
	 mod(lag(CommittedBalance) / CommittedBalance, 10) = 0);
PG
Ask a Question
Discussion stats
  • 3 replies
  • 212 views
  • 0 likes
  • 4 in conversation