cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
chadyoder
Level I

Compute Column Mean while restricting observations used


Hello,

 

I want to get a column mean into a new column but I want to be able to restrict the date range that I use.  I want to be able to say get column mean from day x to day y in my formula.   This is the current formula that i have:

 

New Column ("X",

Numeric,

Continuous,

Format ("Best", 12),

Formula (Col Mean (:WeeklyPercent, :Week, :Source)), Set Selected);

 

 

It pull the average weekly percent by week and source of the data which is perfect, however, even when I put a data filter on the dataset it still pulls the mean for the entire data set by those two by variables.  I want to be able to change the date range that those column means are from.  Can anyone help me with that?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
XanGregg
Staff

Re: Column Mean using only part of the dataset

The column functions operate on the whole table, ignoring selection and exclusions. However, you can make a formula column that's dependent on the row state and use that column as a BY variable.


New Column( "mysel", Formula( Selected( Row State() ) ) );


New Column( "meany", Formula( Col Mean( :y, :mysel) ) );


If you're using the global data filter with selection turned on, the Column Means will be recomputed whenever the selection changes.

View solution in original post

1 REPLY 1
XanGregg
Staff

Re: Column Mean using only part of the dataset

The column functions operate on the whole table, ignoring selection and exclusions. However, you can make a formula column that's dependent on the row state and use that column as a BY variable.


New Column( "mysel", Formula( Selected( Row State() ) ) );


New Column( "meany", Formula( Col Mean( :y, :mysel) ) );


If you're using the global data filter with selection turned on, the Column Means will be recomputed whenever the selection changes.

Recommended Articles