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.
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)
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.