cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
rshehadah
Level I

Percent

Hi,

 

I have a col with values "yes" and "no". Also I have a col of unquie LotNames. How can I find the total percentage of yes for a lotname.

 

I know the logic, just dont know how to do it in JMP.

 

Logic:

 

Percent of yes = Number of "yes" groupby LotName/ Total Rows grouped by LotName

 

Thank you,

Rami

2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: Percent

Attached is a simple Example data table that uses the below formula to create the Percent values you want

yesno.PNG

 

New Table( "example",
	Add Rows( 100 ),
	New Column( "Lot",
		Character( 6 ),
		"Nominal",
		Set Values(
			{"Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1",
			"Lot 1", "Lot 1", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2",
			"Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 3", "Lot 3", "Lot 3", "Lot 3",
			"Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 4", "Lot 4",
			"Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4",
			"Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5",
			"Lot 5", "Lot 5", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6",
			"Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 7", "Lot 7", "Lot 7", "Lot 7",
			"Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 8", "Lot 8",
			"Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8",
			"Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9",
			"Lot 9", "Lot 9", "Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10",
			"Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10"}
		),
		Set Display Width( 48 )
	),
	New Column( "Yes_No",
		Character( 3 ),
		"Nominal",
		Set Values(
			{"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "Yes", "Yes",
			"Yes", "No", "No", "No", "No", "No", "No", "Yes", "Yes", "No", "No",
			"No", "No", "No", "No", "Yes", "No", "No", "Yes", "No", "No", "No",
			"Yes", "No", "Yes", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes",
			"No", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes", "No", "Yes",
			"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "Yes",
			"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "No", "No",
			"No", "Yes", "No", "No", "Yes", "Yes", "No", "Yes", "Yes", "Yes", "Yes",
			"No", "No", "Yes", "No", "No", "Yes", "No", "Yes", "No", "No", "No"}
		),
		Set Display Width( 50 )
	),
	New Column( "Percent",
		Numeric,
		"Continuous",
		Format( "Percent", 12, 2 ),
		Formula(
			Col Number( If( :Yes_No == "Yes", 1, . ), :Lot ) /
			Col Number( :Yes_No, :Lot )
		),
		Set Display Width( 186 )
	)
)

 

Jim

View solution in original post

Jeff_Perkinson
Community Manager Community Manager

Re: Percent

This is easy to do interactively using Tabulate.

 

Drag your LotName column to the rows area, your Y/N to the columns area and then the Row % statistic to the columns area.

 

RowPercentage6.gif

 

-Jeff

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Percent

Attached is a simple Example data table that uses the below formula to create the Percent values you want

yesno.PNG

 

New Table( "example",
	Add Rows( 100 ),
	New Column( "Lot",
		Character( 6 ),
		"Nominal",
		Set Values(
			{"Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1", "Lot 1",
			"Lot 1", "Lot 1", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 2",
			"Lot 2", "Lot 2", "Lot 2", "Lot 2", "Lot 3", "Lot 3", "Lot 3", "Lot 3",
			"Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 3", "Lot 4", "Lot 4",
			"Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4", "Lot 4",
			"Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5", "Lot 5",
			"Lot 5", "Lot 5", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 6",
			"Lot 6", "Lot 6", "Lot 6", "Lot 6", "Lot 7", "Lot 7", "Lot 7", "Lot 7",
			"Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 7", "Lot 8", "Lot 8",
			"Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8", "Lot 8",
			"Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9", "Lot 9",
			"Lot 9", "Lot 9", "Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10",
			"Lot 10", "Lot 10", "Lot 10", "Lot 10", "Lot 10"}
		),
		Set Display Width( 48 )
	),
	New Column( "Yes_No",
		Character( 3 ),
		"Nominal",
		Set Values(
			{"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "Yes", "Yes",
			"Yes", "No", "No", "No", "No", "No", "No", "Yes", "Yes", "No", "No",
			"No", "No", "No", "No", "Yes", "No", "No", "Yes", "No", "No", "No",
			"Yes", "No", "Yes", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes",
			"No", "No", "Yes", "Yes", "No", "No", "No", "Yes", "Yes", "No", "Yes",
			"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "Yes",
			"No", "Yes", "No", "No", "No", "Yes", "No", "No", "No", "No", "No", "No",
			"No", "Yes", "No", "No", "Yes", "Yes", "No", "Yes", "Yes", "Yes", "Yes",
			"No", "No", "Yes", "No", "No", "Yes", "No", "Yes", "No", "No", "No"}
		),
		Set Display Width( 50 )
	),
	New Column( "Percent",
		Numeric,
		"Continuous",
		Format( "Percent", 12, 2 ),
		Formula(
			Col Number( If( :Yes_No == "Yes", 1, . ), :Lot ) /
			Col Number( :Yes_No, :Lot )
		),
		Set Display Width( 186 )
	)
)

 

Jim
Jeff_Perkinson
Community Manager Community Manager

Re: Percent

This is easy to do interactively using Tabulate.

 

Drag your LotName column to the rows area, your Y/N to the columns area and then the Row % statistic to the columns area.

 

RowPercentage6.gif

 

-Jeff