BookmarkSubscribeRSS Feed
RB7
Calcite | Level 5 RB7
Calcite | Level 5

Good afternoon,

 

I am using SAS VA 7.3, and so, I am using the horizontal gauge to display a single value which is "Total Production [MW]".

 

This single value is grouped (SUM) by the data that is either selected on the graphs or filtered on the control objects. 

 

However, we have the category "Power Plant" defined as such:

 

Power Plant 1 - Generator 1

Power Plant 1 - Generator 2

Power Plant 1 (which is the total)

Power Plant 2 - Generator 1

Power Plant 2 - Generator 2

Power Plant 2 - Generator 3

Power Plant 2

Power Plant 3 - Generator 1

Power Plant 3 - Generator 2

Power Plant 3 - Generator 3

Power Plant 3 - Generator 4

Power Plant 3

Total Power Plants

 

So basically, when I have selected of all of these categories to display on the bar graph (which the client requires) the total is not correct, because it group sums all of the categories, and I want to create and advanced filter on the gauge to basically say:

 

IF "Power Plant" NotContains "Generator"

RETURN "Power Plant" NotContains "Generator"

ELSE "Power Plant"

 

This means that if any category's selected are not Generators (which means they are totals) he would ignore the generators values and just SUM the totals. And if there are only Generators selected, he would SUM them up as normal.

 

I have created that code to no results, it doesn't filter anything.

 

Is there a way to solve this? Thank you all. 

1 REPLY 1
don_data
Fluorite | Level 6

While I work with the version in 8.1 and 8.2, I assume the logic would remain the same: 

 

Create a calculated field with the following logic

 

if <field> not contains "Generator" 

then return <value>

else return missing

 

Missing can be replaced with 0 if preferred. In 8.1 and 8.2, there is an option to preview your result. Wherein generator exists, the corresponding result would be missing/ 0.  Values would only exist where the string in the condition does not exist. 

 

Use the calculated field in the gauge. The aggregates of missing/0 values would remain 0, hence giving you the total. 

 

Note: from what I see, you may also need to put an 'AND' clause to remove values pertaining to Total Power PLant ( to avoid duplication)

 

 

Hope this is what you were looking for. 

 

 

 

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 1 reply
  • 1143 views
  • 0 likes
  • 2 in conversation