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: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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