BookmarkSubscribeRSS Feed
haneesh312
Fluorite | Level 6

I would like to aggregated field , which is the difference in percentages between two groups in a category using a calculated fiedls in SAS VA .

 

example:

Data

A

B

A

C

A

B
A

A

B

A

 

% of A -60%

% of B - 30%

 

difference -30%

 

I want difference field  to be caluculated in a field and should be able drill up and down

 

1 REPLY 1
PetriRoine
Pyrite | Level 9

Hello @haneesh312 ,

 

Have you tried creating two new calculated items, one for As and one for Bs, and then calculate the difference?

Something along the lines:

 

New calculated item for As:

IF (Category = 'A' )
RETURN Measure
ELSE 0

And a similar for Bs.

 

Then a new measure to calculate the difference between these two. Of course you need to take care of the percentage of total also.

 

Best regards,

Petri

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 970 views
  • 0 likes
  • 2 in conversation