georgedwilkinson
AWF VIP
- Local time
- Today, 15:12
- Joined
- Mar 4, 2008
- Messages
- 3,856
This works(ish):
I don't like the way Excel calculates quartiles but that is a different issue.
It's also quite slow and the results should be kept in a DSS table to reduce the processing time.
The parentheses are required. Just replace the "qty" with whatever value in the result set you want to calculate quartile for. And replace 2.0 with whatever value represents the quartile you want to calculate for.
This along with the change of name in the module should fix you up.
Code:
SELECT quartile_info.raw_material,
quartile_info.source_tank,
quartile_info.dest_tank,
Count(*) AS NumberOfSamples,
fnct_Quartile("(select * from quartile_info where quartile_info.raw_material = '" & raw_material & "' AND quartile_info.source_tank = '" & source_tank & "' AND quartile_info.dest_tank = '" & dest_tank & "')", "qty", 2.0) AS QtyMedian
FROM quartile_info
GROUP BY quartile_info.raw_material,
quartile_info.source_tank,
quartile_info.dest_tank;
I don't like the way Excel calculates quartiles but that is a different issue.
It's also quite slow and the results should be kept in a DSS table to reduce the processing time.
The parentheses are required. Just replace the "qty" with whatever value in the result set you want to calculate quartile for. And replace 2.0 with whatever value represents the quartile you want to calculate for.
This along with the change of name in the module should fix you up.