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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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