Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends,
Here I have a scenario's please help me out on this ?
I have table like this
parvathi12
| |||||||||||||||||||||||
my requirement is need to create another column (age group)
in that my output should be like this.
age 10 -15
age 16 -20
age 21-25
age 26-30
age 31-35
like this new field get age groups corresponding to the names?
2) what is class function in qlik view ?
Try like:
Load *, 'Age '& Replace(Class(Age, 5), '<= x <','-') as Class Inline [ Name, Age
sivar, 23 rama, 24 krishna, 22 rao, 25 karthik, 10 parvathi,12
deepthi, 15 nkhil, 16 vijay, 28 pavan, 27 Chandra, 30 ramana, 33 ]
Class should be able to help you classify those age groups.
From Qv help file:
Creates a classification of expressions. The bin width is determined by the number set as interval. The result is shown as a<=x<b, where a and b are the upper and lower limits of the bin. The x can be replaced by an arbitrary string stated in label. 0 is normally the default starting point of the classification. This can be changed by adding an offset.
Examples:
class( var,10 ) with var = 23 returns '20<=x<30'
class( var,5,'value' ) with var = 23 returns '20<= value <25'
class( var,10,'x',5 ) with var = 23 returns '15<=x<25'
Try this:
Test:
load Class(Age,5) as Bucket;
LOAD * INLINE [
Name, Age
sivar , 23
rama , 24
krishna , 22
rao , 25
karthik , 10
parvathi, 12
deepthi , 15
nkhil , 16
vijay , 28
pavan , 27
Chandra , 30
ramana , 33
];
Hi,
Below link will help you to understand class function.
Regards,
Kaushik Solanki
Thanks