BookmarkSubscribeRSS Feed
rss18
Calcite | Level 5

 

I have a data set that consists of 11 provinces, semi annual time periods, a indicator, actual value and target value. I'm trying to create a 3d bar chart with axises province X timePeriod X value and then for each province and time period show 2 bars one for actual and one for target.

 

    

My dataset looks like this:

PROVINCE    PERIOD  VAR VALUE
Bandundu    2013S1  OUT_BUD_ODE 250000
Bandundu    2013S1  TAR_BUD_ODE 545000
Bandundu    2013S2  OUT_BUD_ODE 283000
Bandundu    2013S2  TAR_BUD_ODE 545000
Bandundu    2014S1  OUT_BUD_ODE 800000
Bandundu    2014S1  TAR_BUD_ODE 645000
Bandundu    2014S2  OUT_BUD_ODE 700000
Bandundu    2014S2  TAR_BUD_ODE 645000
Bandundu    2015S1  OUT_BUD_ODE 369363
Bandundu    2015S1  TAR_BUD_ODE 945288
Bandundu    2015S2  OUT_BUD_ODE 1217449
Bandundu    2015S2  TAR_BUD_ODE 958417
Bandundu    2016S1  OUT_BUD_ODE 96618
Bandundu    2016S1  TAR_BUD_ODE 787740
Bandundu    2016S2  OUT_BUD_ODE 1358568
Bandundu    2016S2  TAR_BUD_ODE 787740
Bandundu    2017S1  OUT_BUD_ODE 1312900
Bandundu    2017S1  TAR_BUD_ODE 311729
Bandundu    2017S2  OUT_BUD_ODE .
Bandundu    2017S2  TAR_BUD_ODE 1299771
Bas-Congo   2013S1  OUT_BUD_ODE 150000
Bas-Congo   2013S1  TAR_BUD_ODE 450000
Bas-Congo   2013S2  OUT_BUD_ODE 145000
Bas-Congo   2013S2  TAR_BUD_ODE 450000
Bas-Congo   2014S1  OUT_BUD_ODE 1000000
Bas-Congo   2014S1  TAR_BUD_ODE 900965
Bas-Congo   2014S2  OUT_BUD_ODE 900000
Bas-Congo   2014S2  TAR_BUD_ODE 900965
Bas-Congo   2015S1  OUT_BUD_ODE 433892
Bas-Congo   2015S1  TAR_BUD_ODE 1115965
Bas-Congo   2015S2  OUT_BUD_ODE 943387
Bas-Congo   2015S2  TAR_BUD_ODE 1115965
Bas-Congo   2016S1  OUT_BUD_ODE 552002
.
.

The following code is almost there but it stacks the values instead of placing them side by side:

 

    /* Generate the block chart */
proc gchart data=totals;
format quarter roman.;
format sales dollar8.;
label site='00'x dept='00'x;
block site / sumvar=sales
             type=mean
             midpoints='Sydney' 'Atlanta'
             group=dept
             subgroup=quarter
             legend=legend1
             noheading
             coutline=black
             caxis=black;
run;
quit;

 fusion_25509_1_g25509.gif

2 REPLIES 2
Jay54
Meteorite | Level 14

Unless a 3D bar chart is a must, you can use the SGPANEL procedure to panel the graph by province, and then display a side-by-side cluster group bar chart of Actual and Target by date.  See third graph in this article:  https://blogs.sas.com/content/graphicallyspeaking/2012/03/30/cluster-groups/

rss18
Calcite | Level 5
Thanks, this is helpful although we would really like to be able to do this in 3d as specified in the question. I’m thinking this might be possible if we fudge the data a bit although I’m not sure how.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 948 views
  • 0 likes
  • 2 in conversation