- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How Do I create a Column formula for N Categories?
I would like to create a column formula that provides a count of the number of distinct values in a column. I can use the Column viewer, Show summary function in JMP 15 but I want to have that value in a column for use in other calculations.
For example in the Big Class Table - N Items in column "Sex" should show 2 as 2 distinct values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How Do I create a Column formula for N Categories?
here is a wish to add such a functionality
... to JSL
... to New Column Formula
... to Graph Builder
Col N Categories
I guess there are only a few JMP users in the world who don't need it ; )
Most JMP users will be excited to see such a functionality in a future version of JMP (... along with dense ranking )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How Do I create a Column formula for N Categories?
A little late to the thread, but I was looking for a solution to the same problem. The formula below in @CTrahon0526 's datatable reproduces the values in "Unique Tool IDs Per Work Week Per Year" column
Col Sum( Col Cumulative Sum( 1, :Year, :WW, :Tool ID ) == 1, :Year, :WW )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How Do I create a Column formula for N Categories?
Nice, I can use this a lot - so, now I have:
Names Default To Here( 1 );
Try(dt = CurrentDataTable(), stop());
updateLBox = Function( {t},
(t << sib) << setitems( (t << topparent)[listboxbox( 1 )] << getselected )
);
nw = New Window("count unique entries",
<< Type("Modal Dialog"),
Border Box( Left( 10 ), Right( 10 ), bottom( 5 ),
V List Box(
Lineup Box( N Col( 1 ), spacing( 10 ),
// Text Box( "XG Boost Specification" ),
// colistbox only necessary if the script is standalone
H List Box(
Panel Box( "Select Columns", Col List Box( all, nlines( 15 ) ) ),
Panel Box( "Cast Selected Columns into Roles",
Lineup Box( N Col( 2 ),
Button Box("Unique",
<<setfunction( Function( {t}, updateLBox( t ) ) )
),
Cunique = Col List Box( nlines( 2 ), minitems( 1 ) ),
Button Box("By Group",
<<setfunction( Function( {t}, updateLBox( t ) ) )
),
CBy = Col List Box( nlines( 2 ), minitems( 0 ) )
)
)
)
),
spacerbox(size(1,10)),
Button Box( "OK",
<<setfunction(
Function({t}, ColsUnique = Cunique << get items;ColsBy= Cby << get items)
)
),
spacerbox(size(1,10)),
)
)
);
ccs= Expr(Col Cumulative Sum( 1));
for each ({col}, ColsUnique, Insert Into(ccs, Name Expr(As column(col))));
for each ({col}, ColsBy, Insert Into(ccs, Name Expr(As column(col))));
cs = Eval Expr(Col Sum( Expr(Eval Expr(Expr(Name Expr(ccs)) == 1 ))));
for each ({col}, ColsBy, Insert Into(cs, Name Expr(As column(col))));
Eval (Eval Expr(new column ("unique_"|| concat items (ColsUnique,"_"),
Formula(Expr(Name Expr(cs))))))
... available at a single mouse click : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How Do I create a Column formula for N Categories?
to get the next level of interactivity - please vote here:
Transform Columns - as comfortable as Summary Statistics?
e.g. to show the number of car makers - correct values for individual years - and split by door size:
- Chapters
- descriptions off, selected
- captions settings, opens captions settings dialog
- captions off, selected
- en (Main), selected
This is a modal window.
Beginning of dialog window. Escape will cancel and close the window.
End of dialog window.
This is a modal window. This modal can be closed by pressing the Escape key or activating the close button.
... there may be more useful applications : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How Do I create a Column formula for N Categories?
[removed] didn't show up at the right position.
- « Previous
-
- 1
- 2
- Next »