BookmarkSubscribe
Choose Language Hide Translation Bar
Highlighted
twillkickers
Community Trekker

Grouping States Together In Graph Builder Only

Please see the attached graph. I would like to know if there's a convenient way in JMP to group the states together through the graph builder interface. For example, what if I wanted to group New York, Pennsylvania, and New Jersey into a single color called "Northeast"? Or what if I wanted to group the bottom 25 categories into an "Other" color? 

 

I do not want to group things in the data table. I'd like to be able to draw this data from the data table and do the grouping inside graph builder.Crimes.JPG

0 Kudos
1 REPLY 1

Re: Grouping States Together In Graph Builder Only

Transform columns are one way to make data transforms that are local to Graph Builder (or any platform).  Right-click on the column within Graph Builder and there are many built-in transforms.

Untitled.png

 

 

The Formula... option will allow you to define more custom data transforms.  One way to create the transform that you suggest will result in this script:

 

Graph Builder(
	Size( 534, 456 ),
	Show Control Panel( 0 ),
	Variables(
		X( :Year ),
		Y( :Violent Rate ),
		Overlay(
			Transform Column(
				"Custom Region",
				Character,
				Nominal,
				Formula(
					If(
						:State == "New York" | :State == "Pennsylvania" | :State ==
						"New Jersey",
						"Northeast",
						:State
					)
				)
			)
		)
	),
	Elements( Bar( X, Y, Legend( 13 ), Bar Style( "Stacked" ) ) )
);