You could add two formula columns that calculate the maximum - minimum for each sample (temperature and date):
Or run below script to get your example table with formula columns.
New Table( "Example",
Add Rows( 8 ),
New Column( "Sample",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 1, 2, 2, 3, 3, 99, 99] )
),
New Column( "Temperature",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [199, 210, 201, 217, 200, 215, 199, 220] )
),
New Column( "Temp Diff",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Col Maximum( :Temperature, :Sample )
-Col Minimum( :Temperature, :Sample )
)
),
New Column( "Date (ISO 9601 format)",
Numeric,
"Continuous",
Format( "yyyy-mm-dd", 10 ),
Input Format( "yyyy-mm-dd" ),
Set Values(
[3795552000, 3798576000, 3795552000, 3798748800, 3795552000, 3798662400,
3795552000, 3798921600]
)
),
New Column( "Date Diff",
Numeric,
"Continuous",
Format( "Best", 12 ),
Formula(
Date Difference(
Col Minimum( :"Date (ISO 9601 format)"n, :Sample ),
Col Maximum( :"Date (ISO 9601 format)"n, :Sample ),
"Day"
)
)
)
)
And then a quick summary will give you the table you were after: