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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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