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

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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