This is a query on the basis of the following thread
I have a different issue compared to the one above. I need to create a custom category/ calculated item which is unique.
I have attached the screenshot to understand it better - In the bar chart, "Group" is a sum of all revenue across all regions (including APAC, Europe and Americas), APAC is just APAC and "Rest of the world" is Europe and Americas. They are all built off the same variable. I need to create a category/ calculated item to use in a bar chart and assign values accordingly.
Of course the below code doesn't work but below is a sample of how I expect it to work.
IF ( 'Geo'n In ('APAC', 'Europe', 'North America', 'Enterprise') )
RETURN 'Group'
ELSE (
IF ( 'Geo'n = 'APAC' )
RETURN 'APAC'
ELSE 'Rest of the World'
Looks like you are missing a bracket at least:
IF ( 'Geo'n In ('APAC', 'Europe', 'North America', 'Enterprise') )
RETURN 'Group'
ELSE (
IF ( 'Geo'n = 'APAC' )
RETURN 'APAC'
ELSE 'Rest of the World')
True, but that was what I put together quickly to help you understand the problem.
Because I am including all values of 'Geo' to create 'Group' - the new calculated item will always have only one value - Group.
Another reason this is not going to work is you have APAC both in the "GROUP" and as its own category. I suspect you will have to create two custom categories, one for GROUP, and another for APAC/Rest of World. Give it a try.
Exactly, that is the problem. I want to create a category which is custom and I already explained that in the initial question.
it is like writing
sum(All geos) = "Group"
APAC = "APAC"
sum(all geos) - APAC = "RoW"
that is the custom category. is it possible in SAS VA?
You can't sum a character column. I suggest you experiment with splitting your customer category into two separate ones as already discussed.
Try
IF ( Geo= 'APAC' )
RETURN 'APAC'
ELSE 'Rest of the World'
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.