I think, I understand what you want, but not what for it is needed. And I agree to the answers above, that weight might not be the proper way.
If you want to do it simple, I would use the 2 step approach, first calculating the group means, and then calculating the means of the means (ignoring the frequency).
So this means you want each group weighted evenly, and the average is 6, see second screenshot.
But standard in JMP is, that each row has the same weight, as others pointed out already. And if you really need to do this in one "stacked table", you need to calculate the weights in that way, that the result is what you want, but this might get quite complicate and confusing using more groups - so I do not recommend.
Just for illustration see script below.
Names Default To Here( 1 );
// generate example table
dt = New Table( "test weight",
add rows( 5000 ),
New Column( "group", formula( If( Row() > 2000, "B", "A" ) ) ),
New Column( "value", formula( If( Row() > 2000, Random Normal( 8, 1 ), Random Normal( 4, 1 ) ) ) ),
New Column( "weight", formula( If( Row() > 2000, 5000 / 6000, 5000 / 4000 ) ) ),
New Column( "mean", formula( Col Mean( :value ) ) ),
New Column( "group mean", formula( Col Mean( :value, :group ) ) )
);
dt << add properties to table(
{new script(
"By Distribution",
Distribution( Stack( 1 ), Continuous Distribution( Column( :value ), Horizontal Layout( 1 ), Vertical( 0 ) ), By( :group ) )
), new script(
"Weighted Distribution",
Distribution( Stack( 1 ), Continuous Distribution( Column( :value ), Horizontal Layout( 1 ), Vertical( 0 ) ), weight( :weight ) )
)}
);
dt_sum = dt << summary( subgroup( :group ), Mean( value ) );
dt_sum << New Column( "all mean", Formula( Mean( :"Mean(value, A)"n, :"Mean(value, B)"n ) ) );
Georg