Hi,
I've been searching up how to calculate percentile values all day and I still do not seem to be able to get the values that I want. Can someone please help me?
Heres the overview of my situation:
I have a table called Raw Data and it holds fields including 'operating costs' and 'property size'
The percentile value that I want is the 95th and 5th percentile value of 'operating costs/property size'
First step I did was to create a query called 'STEP 1:FACTOR VARIABLES' that calculates 'operating costs/property size'
Second step I made another query that would use my query 'STEP 1:FACTOR VARIABLES' and tried calculating my 5th percentile with the sql code
SELECT Max([Operating Costs/Property Size]) AS [5th percentile Operating Costs/Property]
FROM (SELECT TOP 95 PERCENT [Operating Costs/Property Size] FROM [STEP 1: FACTOR VARIABLES])
ORDER BY Max([Operating Costs/Property Size]);
I thought that this would get the value that I need but all it does is grab the largest 95% of values and then get the max of it, which is basically just the max value itself....
Would I be able to get what I want using SQL or do I have to do some VBA coding?
I've been searching up how to calculate percentile values all day and I still do not seem to be able to get the values that I want. Can someone please help me?
Heres the overview of my situation:
I have a table called Raw Data and it holds fields including 'operating costs' and 'property size'
The percentile value that I want is the 95th and 5th percentile value of 'operating costs/property size'
First step I did was to create a query called 'STEP 1:FACTOR VARIABLES' that calculates 'operating costs/property size'
Second step I made another query that would use my query 'STEP 1:FACTOR VARIABLES' and tried calculating my 5th percentile with the sql code
SELECT Max([Operating Costs/Property Size]) AS [5th percentile Operating Costs/Property]
FROM (SELECT TOP 95 PERCENT [Operating Costs/Property Size] FROM [STEP 1: FACTOR VARIABLES])
ORDER BY Max([Operating Costs/Property Size]);
I thought that this would get the value that I need but all it does is grab the largest 95% of values and then get the max of it, which is basically just the max value itself....
Would I be able to get what I want using SQL or do I have to do some VBA coding?