Re: function to limit value of integer

2011-02-11 Thread Riebold, Philip
log(2, no_of_jobs + 1) will give 0 for 0 jobs, 1 for 1 job, 1.58 for 2 etc. etc. On 11 Feb 2011, at 14:04, Johan De Meersman wrote: > How about the square root of the number of jobs, or some other root if you > want another coefficient? That doesn't have the limiting behaviour a > logarithmic fu

Re: function to limit value of integer

2011-02-11 Thread Johan De Meersman
How about the square root of the number of jobs, or some other root if you want another coefficient? That doesn't have the limiting behaviour a logarithmic function offers, though. On Fri, Feb 11, 2011 at 2:08 PM, Richard Reina wrote: > Hi Travis, > > This is very helpful thank you. Howev

Re: function to limit value of integer

2011-02-11 Thread Richard Reina
Hi Travis, This is very helpful thank you. However, is there a way to make it not be less than a 1. As it's written below someone with one job gets a zero and someone with no jobs gets a NULL. It would be great if someone with 1 job got a 1 and someone with zero jobs got a 0. Thanks again, R

RE: function to limit value of integer

2011-02-10 Thread Travis Ard
Maybe some sort of logarithmic expression? select no_of_jobs, 10 * log(10, no_of_jobs) as job_weight from data; Of course, you'd have to tweak your coefficients to match the weighting system you want to use. -Travis -Original Message- From: Richard Reina [mailto:gatorre...@gmail.com] S