BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Achraf_Ougdal
Obsidian | Level 7

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

Capture1.png

 

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.

 

Capture2.png

 

Thank you very much 

1 ACCEPTED SOLUTION

Accepted Solutions
yabwon
Onyx | Level 15

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



View solution in original post

2 REPLIES 2
yabwon
Onyx | Level 15

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



Achraf_Ougdal
Obsidian | Level 7

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

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
  • 2 replies
  • 729 views
  • 0 likes
  • 2 in conversation