- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Greetings,
I have researched many posts regarding waterfall charts, and every example I have seen has the data vertically, meaning every observation will output to the same chart:
data DataDir.SJUCost;
input Name $
Number
Color $;
datalines;
2018 755575 Red
VFM 5628 Red
INT 135364 Red
OTH 3222 Red
DFM -138900 Green
;
run;
proc template;
define statgraph waterfall;
begingraph;
layout overlay;
waterfallchart category=name response=number /
colorgroup=color
barlabel=true
name='waterfall'
dataskin=sheen
filltype=solid
initialbarattrs=(color=gray4f)
display=(connect fill outline);
endlayout;
endgraph;
end;
proc sgrender template=waterfall data=DataDir.SJUCost;
title '2018 SJU Check Cost';
run;
But this is not my case, in my dataset, I need the waterfall chart to take in the variables horizontally, meaning I need to output a chart for every observation on the dataset (30 obs) . Here is the same data above:
data DataDir.SJUCost;
input Name $
Number
Color $;
datalines;
755575 5628 135364 3222 -138900
;
run;
How can i process the data horizontally?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If you want one chart per observation why are you doing a waterfall chart? The purpose of that type chart is partially to show the contribution to a total of each group.
And if by chart you actually mean one chart of one set of data then perhaps you want to use BY group processing based on something that identifies which "chart" is which. Since you would have to indicate the high and low values for each chart separately then perhaps you can provide data that would be appropriate as the bar limits from one chart are not going to carry over into a completely separate chart. At which point is sounds like you actually want a HIGHLOW plot.
Or can you show an example of what you want? It often takes much more than a thousand words to describe a picture...
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply.
OK, so I transposed the data set to, now its all vertical:
So for the data above, I need to plot only the highlighted data. One waterfall chart for col B and C, then col B and D, then Col B and E. and so forth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ok, back to the basic data set, where I have all waterfall data points contained in each observation, and each observation is an independent chart. Would something like this be possible, recurse over the data set and draw a waterfall chart for each?
data have;
input sta $ budget $ VFM $ INT $ OTH $ DFM $;
datalines;
sta budget VFM INT OTH DFM
sju 755575 5628 135364 3222 -138900
maz 885634 4663 2522 -2525 252452
;
run;
data _null_;
set have;
proc sgrender template=waterfall data=have;
title '2018 SJU Check Cost';
run;
end;