dynamobi/dynamobi — Issue #303: [LDB-17] BB UDFs: age_range, company_revenue, education_level, and number_of_employees 
Author: dynamobi-build
Created: 2011-12-30 02:28:20+00:00
State: open
Labels: LDB

[reporter="boris", created="Mon, 30 Jan 2006 11:33:30 -0500 (GMT-05:00)"]

In Kana application, there are

a) AGE_RANGE(age_range varchar)

case "AGE_RANGE" WHEN 'Under 15' THEN 1 WHEN 'Under 18' THEN 2 WHEN '15-17' THEN 3 WHEN '19-29' THEN 4 WHEN '18-24' THEN 5 WHEN '30-39' THEN 6 WHEN '25-34' THEN 7 WHEN '40-49' THEN 8 WHEN '35-44' THEN 9 WHEN '50-59' THEN 10 WHEN '45-54' THEN 11 WHEN '60-69' THEN 12 WHEN '55-64' THEN 13 WHEN 'Over 70' THEN 14 WHEN 'Over 65' THEN 15 ELSE 0 END

b) Company_revenue(revenue Numeric)

case WHEN ("REVENUE" >= 1 and "REVENUE" <= 499999) THEN

' 0 - 0.5 million'

WHEN ("REVENUE" > 499999 and "REVENUE" <= 999999) THEN

' 0.5 - 1 million'

WHEN ("REVENUE" > 999999 and "REVENUE" <= 4999999) THEN

' 1 - 4.99 million'

WHEN ("REVENUE" > 4999999 and "REVENUE" <= 9999999) THEN

' 5 - 9.99 million'

WHEN ("REVENUE" > 9999999 and "REVENUE" <= 49999999) THEN

' 10 - 49.99 million'

WHEN ("REVENUE" > 49999999 and "REVENUE" <= 99999999) THEN

' 50 - 99.99 million'

WHEN ("REVENUE" > 99999999 and "REVENUE" <= 499999999) THEN

' 100 - 499.99 million'

WHEN ("REVENUE" > 499999999 and "REVENUE" <= 999999999) THEN

' 500 - 999.99 million'

WHEN ("REVENUE" > 999999999 ) THEN

' > 1 billion'

else 'UNKNOWN'

end

c) Educational_Level (EDUCATIONAL LEVEL varchar)

case "EDUCATIONAL_LEVEL" when 'In High School' then 1 when 'High School' then 2 when 'In College' then 3 when 'Some College' then 4 when 'College' then 5 when 'College Graduate' then 6 when 'In Graduate School' then 7 when 'Graduate' then 8 when 'Graduate Degree' then 9 when 'Professional Degree' then 10 ELSE 0 END

d) NUMBER_OF_EMPLOYEES (num_of_emp integer)

case WHEN ("NUM_OF_EMP" >= 1 and "NUM_OF_EMP" <= 24) THEN ' 1-24'

WHEN ("NUM_OF_EMP" >= 25 and "NUM_OF_EMP" <= 49) THEN ' 25-49'

WHEN ("NUM_OF_EMP" >= 50 and "NUM_OF_EMP" <= 99) THEN ' 50-99'

WHEN ("NUM_OF_EMP" >= 100 and "NUM_OF_EMP" <= 499) THEN ' 100-499'

WHEN ("NUM_OF_EMP" >= 500 and "NUM_OF_EMP" <= 999) THEN ' 500-999'

WHEN ("NUM_OF_EMP" >= 1000 and "NUM_OF_EMP" <= 4999) THEN ' 1000-4999'

WHEN ("NUM_OF_EMP" >= 5000 and "NUM_OF_EMP" <= 9999) THEN ' 5000-5999'

WHEN ("NUM_OF_EMP" >= 10000 and "NUM_OF_EMP" <= 19999) THEN '10000-19999'

WHEN ("NUM_OF_EMP" >= 20000 ) THEN '> 20000'

else 'UNKNOWN'

end