BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
KarunaTiwari
Obsidian | Level 7

Hi All,

 

I have a Category field GEO which has values like India, USA and UK.

Now I want to show the revenues of India vs Overall in a bar chart.

I am able to create custom category -India(India) and Others (UK, USA).

But I want to create custom categories - India(India) and Overall (India, UK, USA).

How can I achieve that?

 

Thanks in advance!!

1 ACCEPTED SOLUTION

Accepted Solutions
itchyeyeballs
Pyrite | Level 9

Like this?

 

Capture.GIF

 

Formula for india is 

 

IF ( 'GEO'n = 'INDIA' )
RETURN 1
ELSE 0

For overall I just used the default frequency measure but renamed it

View solution in original post

16 REPLIES 16
collinelliot
Barite | Level 11

I would look into a multilabel format. That might do what you want. 

 

Here's an example that might get you started:

 

http://blogs.sas.com/content/sgf/2016/12/16/creating-and-using-multilabel-formats/

collinelliot
Barite | Level 11

I actually have no idea if these are applicable in Visual Analytics. I should have read the topic area of your post more carefully.

itchyeyeballs
Pyrite | Level 9

One way would be to create calculated fields that can be agregated, something like:

 

IF ( 'GEO'n = 'INDIA' )
RETURN {1}
ELSE {0}
IF ( 'GEO'n In ('INDIA', 'US','UK') )
RETURN {1}
ELSE {0}

Then just use those calculated fields in the chart

KarunaTiwari
Obsidian | Level 7

@itchyeyeballs Thanks for your reply.

I tried creating calculated fields as suggested by you but that did not work.

 

I want a bar chart like below:

InkedCapture_LI.jpg

itchyeyeballs
Pyrite | Level 9

Can you post details of what you tried and how it went wrong?

 

 

I just kncked this one up

 Capture.GIF

 

KarunaTiwari
Obsidian | Level 7

Hi @itchyeyeballs,

 

I have two columns in my data GEO and Business Verticals.

The GEO field contains - India, UK, USA, etc

I want to create a barchart showing the Distribution of Business verticals in India vs all the countries(including India). 

 

Capture.PNG

 

I tried to create two calculated items - Geo_India which is equal to 1 when GEO = India; otherwise 0

                                                             Geo_Overall which is equal to 1 when GEO in (India, UK, USA); otherwise 1

then was trying to convert these 2 measures to category to be used in the bar chart.

but did not get what i wanted to achieve.

 

 

Other option that I tried earlier was to create a custom category with the help of GEO field.

But then I am not able to put India under both the labels - India and Overall.

 

Thanks for your help.

itchyeyeballs
Pyrite | Level 9

Put your two calculated fields into the measures section of the visual

Capture.GIF

 

KarunaTiwari
Obsidian | Level 7

@itchyeyeballs

If I put my two calculated fields into the measures section of the visual, then it will show me the frequency of these two calculate fields but I want to show the frequency of Business Verticals based on these calculated fields (Number of Business Verticals in India vs number of Business vertiacls Overall)

Basically I want to use them as categories.

 

itchyeyeballs
Pyrite | Level 9

Does the business verticals column hold numbers that you want to sum?

If you you could change you calculated fields to

 

 

IF ( 'GEO'n = 'INDIA' )
RETURN 'Business Verticals column'n
ELSE {0}
KarunaTiwari
Obsidian | Level 7

@itchyeyeballs

No Business Verticals is a categorical field and I want to show frequency of Business Verticals based on GEO.

itchyeyeballs
Pyrite | Level 9

If you put the business verticals category into the category role, then the two calculated fields as measures it should give a chart with India vs Total for each bsuiness vertical.

 

If thats not what you need can you share some dummy data?

KarunaTiwari
Obsidian | Level 7

@itchyeyeballs Thanks a ton for your time.

 

Please find attached the dummy data and the graph (Both in Excel).

KarunaTiwari
Obsidian | Level 7

@collinelliot No Problem.. Thanks for you reply.

itchyeyeballs
Pyrite | Level 9

Like this?

 

Capture.GIF

 

Formula for india is 

 

IF ( 'GEO'n = 'INDIA' )
RETURN 1
ELSE 0

For overall I just used the default frequency measure but renamed it

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 16 replies
  • 3489 views
  • 5 likes
  • 3 in conversation