BookmarkSubscribeRSS Feed
MM88
Calcite | Level 5

Hi experts,

 

 Is it possible to return missing value in an aggregated measure in SAS Visual Analytics?

 

 Example:

 

IF ( Max [_ByGroup_] (TreatAs(_Number_, 'Date1'n[Raw])) <= Max [_ByGroup_] (TreatAs(_Number_, 'Date2'n[Raw])) )
RETURN ( Sum [_ByGroup_] ('myvar1'n) / Sum [_ByGroup_] ('myvar2'n) )
ELSE .

 SAS gives an error saying that there is an element that cannot be aggregated (the missing .)

 

 I don't like to return 0. Are there any options to return missing?

 

Thanks

3 REPLIES 3
Madelyn_SAS
SAS Super FREQ

Did you try the MISSING function instead of .

MM88
Calcite | Level 5
@Madelyn_SAS, coould you please give an example? SAS VA gives error because MISSING function return bool, instead of numeric.
MM88
Calcite | Level 5

Hi community,

 

Perhaps there is a better solution. I made it work creating a 'dummy' integer variable containing only missing in the data source. 

 

Applying any function (Min [_ByGroup_], Max [_ByGroup_]) to this variable in SAs Visual Analytics you can obtain the missing value.

 

Any other ideas, please share.

 

Regards.

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
  • 673 views
  • 0 likes
  • 2 in conversation