Stevea sample
the data provided is only a sample.I have so
many rows of FC in the region of 2000
I want a select statement that statistically group all the data into quartile
the equivalent of Excel's Quartile(Array,Quart
Where the values falls within the statistical upper quartile(1) assign 1 for that valu
Where the values falls within the statistical lower quartile(3) assign 3 for that valu
Where the values falls within the statistical midian(2) assign 2 for that valu
Hope this is clear
Thank
Poga
----- Steve Kass wrote: ----
Pogas
Can you be more specific about your definition of quartile? Given the
4 numbers 3, 76, 12, and 20, the usual statistical quartiles would put
one value in each quartile, since there are 4 distinct values. Do you
mean FC to be a percentile, in which case you want FCRanking to b
case when FC > 75 then
when FC > 50 then
when FC > 25 then
else 4 en
-- possibly with >=, depending on your definition
Steve Kas
Drew Universit
[quoted text, click to view] Pogas wrote
>Hi, your prompt help in this will be greatly appreciated
>>I have an sql table below with some sample dat
>>Table-FunctionalConten
>>TrustCode OFA FC
>5A1 20000 2
>RR8 18598 1
>RBA 36578 7
>5HA 4300
>>TrustCode – Identity, Primary Key, char(4
>OFA – numeri
> FC-numeri
>>I want to write a select statement that will add an additional column called FCRanking, and assign the appropriate quartile(Upper quartile,,median and lower quartile) to the FC value
>>Ie
>>TrustCode OFA FC FCRankin
>5A1 20000 20
>RR8 18598 12
>RBA 36578 76
>5HA 4300 3
>>Hope I have made myself clear
>>Many thank
>>Poga
Pogas,
Can you be more specific about your definition of quartile? Given the
4 numbers 3, 76, 12, and 20, the usual statistical quartiles would put
one value in each quartile, since there are 4 distinct values. Do you
mean FC to be a percentile, in which case you want FCRanking to be
case when FC > 75 then 1
when FC > 50 then 2
when FC > 25 then 3
else 4 end
-- possibly with >=, depending on your definition.
Steve Kass
Drew University
[quoted text, click to view] Pogas wrote:
>Hi, your prompt help in this will be greatly appreciated.
>
>I have an sql table below with some sample data
>
>Table-FunctionalContent
>
>TrustCode OFA FC
>5A1 20000 20
>RR8 18598 12
>RBA 36578 76
>5HA 4300 3
>
>TrustCode – Identity, Primary Key, char(4)
>OFA – numeric
> FC-numeric
>
>I want to write a select statement that will add an additional column called FCRanking, and assign the appropriate quartile(Upper quartile,,median and lower quartile) to the FC values
>
>Ie
>
>TrustCode OFA FC FCRanking
>5A1 20000 20 3
>RR8 18598 12 3
>RBA 36578 76 1
>5HA 4300 3 4
>
>Hope I have made myself clear.
>
>Many thanks
>
>Pogas
>
>
>
>
Don't see what you're looking for? Try a search.