BookmarkSubscribeRSS Feed
Pili1100
Obsidian | Level 7

This is my simple calculation: 

X = Sum [_ByGroup_] ('y'n) - Sum [_ByGroup_] ('z'n)

 

If either y or z is missing then x become missing. Here is an example

 

Pili1100_0-1630530620585.png

I want y = 9, z = 0 -> X = 9

Otherwise I will Group the vales in SAS EG before uploading to Viya. 

3 REPLIES 3
japelin
Rhodochrosite | Level 12

try using ifn function.

 

for example

  x=y-ifn(missing(z),0,z);
Sam_SAS
SAS Employee

In the Visual Analytics expression editor, you would use the Missing() operator, like this:

 

IF ( 'Invoice'n Missing )
RETURN 0
ELSE 'Invoice'n

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 743 views
  • 0 likes
  • 3 in conversation