BookmarkSubscribeRSS Feed
soumyasen
Calcite | Level 5

Hi Everybody

 

I am trying to create a simple Excel Bar chart in SAS Visual Analytics. I have to make year on year comparison for the values of different kinds of measures in a bar graph.

 

I have attached the excel graph with the data.

It may be very simple but its urgent.

 

Kind Regards

Soumya Sen

11 REPLIES 11
Sam_SAS
SAS Employee

For convenience, here is the graph from Soumya's spreadsheet:

 

bar.png

 

The bar chart has 3 measures, a group variable, but no category variable.

 

Anyone have a suggestion of how this can be created in VA?

 

Thanks,

Sam

PeterWijers
Lapis Lazuli | Level 10

Hi Soumya,

Its possible while making a new calculated field per year.  I did cut off the left axis...

16-02-2016 17-03-38.png

Use the following code per year (F.Year in our case)

IF ( 'F.Year.'n = Year(DatePart(Now())) )
RETURN 'Sal.Val.€.'n
ELSE 0

 

And this one for the last year.

IF ( 'F.Year.'n = ( Year(DatePart(Now())) - 1 ) )
RETURN 'Sal.Val.€.'n
ELSE 0

 

Drag both variables into the bargraph and magic happens....

Greetings  Peter

 

 

 

soumyasen
Calcite | Level 5

I have developed the following variables:

My variable is named ‘Year’ so used Year('Year'n): so dint get confused on that.

  1. For measure variable loss and for 2015 I have created a new variable called FY2015_loss

IF ( Year('Year'n) = ( Year(DatePart(Now())) - 1 ) )

RETURN 'loss'n

ELSE 0

 

  1. For measure variable loss and for 2016 I have created a new variable called FY2015_loss

IF ( Year('Year'n) = Year(DatePart(Now())) )

RETURN 'loss'n

ELSE 0

 

 

  1. For measure variable revenue and for 2015 I have created a new variable called FY2015_revenue

IF ( Year('Year'n) = Year(DatePart(Now())) )

RETURN 'loss'n

ELSE 0

 

  1. For measure variable revenue and for 2016 I have created a new variable called FY2016_revenue

IF ( Year('Year'n) = Year(DatePart(Now())) )

RETURN 'loss'n

ELSE 0

 

 

But when I am assigning the variables the visual is not getting generated.

Please find attached in the last page what is the error.

 

 

soumyasen
Calcite | Level 5

Also one thing how did you cut the left axis

PeterWijers
Lapis Lazuli | Level 10
The axes have been cut off for this screenprint.
Not that VA could do this .
Greetings
PeterWijers
Lapis Lazuli | Level 10

You have not used a category yet, and you must use it to have the bars to show.
Thats what i see in your screen print, the rest seems to be ok.
Greetings

soumyasen
Calcite | Level 5

Thanks but in the excel we are not using any category .

PeterWijers
Lapis Lazuli | Level 10

I am very confused now.

Your categories are  Expence, Debt and CostOfDebt.....

Greetings

soumyasen
Calcite | Level 5

But Thanks a lot.

Using a category I can arrive at that.

soumyasen
Calcite | Level 5

One thing . My Measure values are under Expense, Debt . They are not categories /neither they appear under category list in SAS VA

soumyasen
Calcite | Level 5

Sorry to confuse you.

 

In my excel sheet you will find Year as my category.

 

And Expense ,Debt and Cost of Debt as the measure variables. So they dont appear under the category list.

 

Kind Regards

Soumya Sen

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 11 replies
  • 2872 views
  • 0 likes
  • 3 in conversation