BookmarkSubscribeRSS Feed
RHECK
Fluorite | Level 6

Hello,
I have in SAS VA an aggregated measure as follows:

 

IF ( ( Sum [_ByGroup_] ('Lf. Monat'n) <> 0 ) AND ( Sum [_ByGroup_] ('UMS'n) <> 0 ) )
RETURN ( Sum [_ByGroup_] ('Lf. Monat'n) / Sum [_ByGroup_] ('UMS'n) )
ELSE 0

 

This formula calculates now on all members of a category called POSITION. I want to limit now the calculation on all positions except the one calle "FAKT_STD". So it should look similar to this one: 

 

IF ( ( Sum [_ByGroup_] ('Lf. Monat'n) <> 0 ) AND ( Sum [_ByGroup_] ('UMS'n) <> 0 )

AND ( POSITION<> 'FAKT_STD' )

)
RETURN ( Sum [_ByGroup_] ('Lf. Monat'n) / Sum [_ByGroup_] ('UMS'n) )
ELSE 0

Unfortunately this expression is not accepted by the system.

Does anybody know how the expression should look like?

Thx

Robert

3 REPLIES 3
Madelyn_SAS
SAS Super FREQ

Can you tell us which version of Visual Analytics you are using? 

 

When you say "not accepted," is there an error message or a warning in the Expression dialog box? If yes, what is it? If not, then can you provide more details about "not accepted." 

RHECK
Fluorite | Level 6

Hi Madelyn,

We are using VA 7.3.

The meesage that I get is the following:

RHECK_0-1591709938534.png

The german message ranslate to "Arguments should be of same type. One type is numeric the other alphanumeric"

Thx

Robert

KeithM
SAS Employee

The message is coming from the expression Position <> "FAKT_STD".   To get this to work, turn that into a numeric expression by doing the following:

1. Create a numeric calculated data item called  Position Flag.

2. In the expression for Position Flag make it look like:     If Position <> "FAKT_STD" return 1 else 0

 

3. Modify your % v.UMS.(Lf.M) calculation and replace (Position <> "FAKT_STD") with "Position Flag"n >= 1

 

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
  • 1211 views
  • 0 likes
  • 3 in conversation