Turn on suggestions

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

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Get Max Min Ave every hours

Topic Options

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

Highlighted

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

May 20, 2016 1:07 AM
(4150 views)

Hi,

Attached is an example of raw data I am getting every day.

I would like to create a new table with the Max, Min and Average every hours for each columns.

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions

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

Yes, Summary() is the platform I would use. If you for some reason don't want to add columns to the original table, the platform supports custom transformed formulas as a grouping variable. Here's an jsl example:

Data Table**(**"Test.jmp"**)** << **Summary****(**

Group**(**

Transform Column**(**

"Time (whole hours)",

Format**(**"Locale Date Time h:m", **19****)**,

Formula**(**Floor**(**:Time / **3600****)** * **3600****)**

**)**

**)**,

Mean**(**:A**)**,

Mean**(**:B**)**,

Mean**(**:C**)**,

Mean**(**:D**)**,

Mean**(**:E**)**,

Min**(**:A**)**,

Min**(**:B**)**,

Min**(**:C**)**,

Min**(**:D**)**,

Min**(**:E**)**,

Max**(**:A**)**,

Max**(**:B**)**,

Max**(**:C**)**,

Max**(**:D**)**,

Max**(**:E**)**,

**)**;

3 REPLIES 3

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

Re: Get Max Min Ave every hours

One way is to define some auxiliary formula columns, then make the summary table. To see this, do 'File > New > New Script', cut and paste the code below, then do 'Edit > Run Script':

NamesDefaultToHere**(****1****)**;

dt = Data Table**(** "Test.jmp"**)**;

// Add some formula columns

dt << **New Column****(** "Year",

Numeric,

"Continuous",

Format**(** "Best", **12** **)**,

Formula**(** Year**(** :Time **)** **)**

**)**;

dt << **New Column****(** "Day of Year",

Numeric,

"Continuous",

Format**(** "Best", **12** **)**,

Formula**(** Day Of Year**(** :Time **)** **)**

**)**;

dt << **New Column****(** "Hour",

Numeric,

"Continuous",

Format**(** "Best", **12** **)**,

Formula**(** Hour**(** :Time **)** **)**

**)**;

// Make the summary table

dt2 = dt << **Summary****(**

Group**(** :Year, :Day of Year, :Hour **)**,

Mean**(** :A **)**,

Mean**(** :B **)**,

Mean**(** :C **)**,

Mean**(** :D **)**,

Mean**(** :E **)**,

Freq**(** "None" **)**,

Weight**(** "None" **)**

**)**;

(Depending on the scope of your data, you might not need the 'Year' column, but it's better to be safe).

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

Yes, Summary() is the platform I would use. If you for some reason don't want to add columns to the original table, the platform supports custom transformed formulas as a grouping variable. Here's an jsl example:

Data Table**(**"Test.jmp"**)** << **Summary****(**

Group**(**

Transform Column**(**

"Time (whole hours)",

Format**(**"Locale Date Time h:m", **19****)**,

Formula**(**Floor**(**:Time / **3600****)** * **3600****)**

**)**

**)**,

Mean**(**:A**)**,

Mean**(**:B**)**,

Mean**(**:C**)**,

Mean**(**:D**)**,

Mean**(**:E**)**,

Min**(**:A**)**,

Min**(**:B**)**,

Min**(**:C**)**,

Min**(**:D**)**,

Min**(**:E**)**,

Max**(**:A**)**,

Max**(**:B**)**,

Max**(**:C**)**,

Max**(**:D**)**,

Max**(**:E**)**,

**)**;

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

Re: Get Max Min Ave every hours

t is exatly what I need !

thanks very much for the quick answer !!