Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Use of N Categories(:column) from Summary table fo...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 4, 2014 5:30 PM
(1512 views)

Hi, I would like to inquire how to make use of N Categories(:X) resut in summary to make mathematical operations via script. It seems the :N Categories (:column) can not be used directly to do the computations, even if I rename or make another numeric column, blk_count. Here is what i have:

dt_ax = dt_X << Summary (

Group (:abx),

N Categories (:blk),

Link to original table (0));

dt_X << Update (

with (dt_ax),

Match Columns(:abx = :abx),

Ignore missing);

close(dt_ax, no save);

dt_X << New column("blk_count",

Numeric,

continuous,

<< set each value(blk_count == :N Categories( :blk ));

Appreciate all your inputs! Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 5, 2014 8:53 AM
(2802 views)

Solution

This will give you the number of levels for a specified column:

dt_X<<new column("N Levels of blk", formula(

Summarize( x = by( :blk ) );

N Items( x );));

If you wanted to know how many rows are in each level then the Col Number function work:

Col Number( :blk, :blk )

2 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 5, 2014 8:53 AM
(2803 views)

This will give you the number of levels for a specified column:

dt_X<<new column("N Levels of blk", formula(

Summarize( x = by( :blk ) );

N Items( x );));

If you wanted to know how many rows are in each level then the Col Number function work:

Col Number( :blk, :blk )

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Aug 6, 2014 5:35 AM
(1401 views)