Obsidian | Level 7

## Calculate total of a measure while ignoring filters

Hello,

I have a bit of a special need. I would like to calculate the % of a calculated item but while ignoring the filters.

For example I have the following Data

If I want to filter on the European Countries, I would like the % to take the total of value (580) and not 350 (150+200).

In other words the % should be like this : Sum(For_Group) Value / Sum (For_All ignoring the filter) Value like this.

Thank you very much

1 ACCEPTED SOLUTION

Accepted Solutions
Onyx | Level 15

## Re: Calculate total of a measure while ignoring filters

1) Provide some example data (in form of a data step) we could use to help you.

2) What code did you test?

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation

2 REPLIES 2
Onyx | Level 15

## Re: Calculate total of a measure while ignoring filters

1) Provide some example data (in form of a data step) we could use to help you.

2) What code did you test?

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation

Obsidian | Level 7

## Re: Calculate total of a measure while ignoring filters

Hello, Unfortunately, I am unable to provide any data example. I am working on SAS Visual Analaytics on SAS 9.4 (Windows).

This is the Expression I used to calculate the % : ( Sum [_ByGroup_] ('Value'n) / Sum [_ForAll_] (
'Value'n) ) * 100

But the problem is when I filter on the Continent the Sum [_ForAll_] ('Value'n) takes the total of the continent (It's vulnerable to the filter) I want it to ignore the filter and take the Sum(Value) for all countries in all continents.

Thank you

Discussion stats
• 2 replies
• 489 views
• 0 likes
• 2 in conversation