Sample 69821: Show changes in transaction values with the Waterfall WATERFALL statement
This SAS Note provides a sample on how to use the WATERFALL statement in PROC SGPLOT to show changes in transaction values.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
This sample code uses the WATERFALL statement in PROC SGPLOT to show changes in transaction values.
/* Create sample transaction data */
data transactions;
length id $10;
format Amount dollar.;
input ID $ Amount type $;
datalines;
Income-1 2000 Credit
Income-2 1000 Credit
Interest 200 Credit
Rent -800 Debit
Car -400 Debit
Grocery -500 Debit
Utilities -400 Debit
;
run;
ods graphics / reset attrpriority=none width=6in height=4in imagename="WaterfallChart";
title 'Cash Flow';
proc sgplot data=transactions;
/* Define the colors for the Credit and Debit bars */
styleattrs datacolors=(cx8FB38F cxF2AE49);
waterfall category=id response=amount / colorgroup=type dataskin=sheen
datalabel finalbarattrs=(color= gray99);
keylegend / title='Transaction type' location=inside position=topright across=1;
xaxis display=(nolabel);
yaxis grid display=(nolabel) offsetmin=0;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Topic: | SAS Reference ==> Procedures ==> SGPLOT
|
Date Modified: | 2023-01-31 13:29:54 |
Date Created: | 2023-01-20 13:34:38 |
Operating System and Release Information
SAS System | Base SAS | Microsoft Windows Server 2012 Std | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows Server 2012 R2 Std | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows Server 2012 R2 Datacenter | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows Server 2012 Datacenter | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows Server 2008 for x64 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows Server 2008 R2 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows Server 2008 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 10 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Pro x64 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Pro 32-bit | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Enterprise x64 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8.1 Enterprise 32-bit | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8 Pro x64 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8 Pro 32-bit | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8 Enterprise x64 | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft Windows 8 Enterprise 32-bit | 9.4_M3 | | 9.4 TS1M3 | |
Microsoft® Windows® for x64 | 9.4_M3 | | 9.4 TS1M3 | |
z/OS 64-bit | 9.4_M3 | | 9.4 TS1M3 | |
z/OS | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Enterprise 32 bit | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Enterprise x64 | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Home Premium 32 bit | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Home Premium x64 | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Professional 32 bit | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Professional x64 | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Ultimate 32 bit | 9.4_M3 | | 9.4 TS1M3 | |
Windows 7 Ultimate x64 | 9.4_M3 | | 9.4 TS1M3 | |
64-bit Enabled AIX | 9.4_M3 | | 9.4 TS1M3 | |
64-bit Enabled Solaris | 9.4_M3 | | 9.4 TS1M3 | |
HP-UX IPF | 9.4_M3 | | 9.4 TS1M3 | |
Linux for x64 | 9.4_M3 | | 9.4 TS1M3 | |
Solaris for x64 | 9.4_M3 | | 9.4 TS1M3 | |