Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
What does this expression do? Thanks in advance.
replace(Class(Age,5), '<= x <','-') as GroupAge,
explain in yellow and bold in script
tmp:
load
RowNo() as People,
floor(rand()*100) as Age
AutoGenerate 100;
load
*,
replace(Class(Age,5), '<= x <','-') as GroupAge,
Class(Age,5) as GroupAge2
Resident tmp;
DROP Table tmp;
Please explain and give an example.
explain in yellow and bold in script
tmp:
load
RowNo() as People,
floor(rand()*100) as Age
AutoGenerate 100;
load
*,
replace(Class(Age,5), '<= x <','-') as GroupAge,
Class(Age,5) as GroupAge2
Resident tmp;
DROP Table tmp;
Hi maxgro
Thank you so much. I got it.
Hi,
Class() is used to group the values with the specified ranges or called it as Buckets.
replace(Class(Age,5), '<= x <','-') as GroupAge
The above script creates the age group with the interval of 5, when you do this you will the format like
5 <= x < 10 to remove the symbols between the we use the Replace().
HOpe this helps you.
Regards,
Jagan.
Hi jagan
Thank you for detail explanation.