Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello all, need helpp 😄
in my customer database has a [BirthDate] field.
to get customer age,
i use :
year(today() - year(BirthDate) as Age,
and, in pie chart
i use dimension [Age], and expresion [sum(sales)],
from that i can see Sales by Customer Age.
but the problem is,
the pie chart show in all age. not in range
the question is,
can i set range between age in pie chart?
i have already tried class function, CLASS(Age,10,'Age_Range')
but the result is not good enough, because the range between age is fix by 10.
i want to set a diferrent range in age,
this is my range between age,
>=80
60 - 79
40- 59
30-39
20-29
<=19
i have tried load it by INLINE too, but it doesn't work properly,
maybe wrong in syntax, plis help me
what is the INLINE LOAD syntax?
this is what i type,
LOAD * INLINE [
Age, Age_Range
>= 80, 80 Above
>=60<=79, 60 - 79
>=40<=59, 40- 59
>=30<=39, 30 - 39
>=20<=29, 20 - 29
<=19, Under 19
];
the syntax above won't work,
plis can somebody help?
regards...
Thank you before
Hi,
You can create a new field 'Age Range' in your script as follows,
if(Age<20,'Under 19',if(Age>=20 and Age<=29,'20-29',if( Age>=30 and Age <=39, '30 - 39',if(Age>=40 and Age<=59, '40- 59',if(Age>=60 and Age<=79, '60 - 79','80 Above')))))
You can use the above field as dimension in the chart and get the desired output.
-Haneesh
anybody help pliss...
thank you
anybody help pliss...
thank you
Hi,
You can create a new field 'Age Range' in your script as follows,
if(Age<20,'Under 19',if(Age>=20 and Age<=29,'20-29',if( Age>=30 and Age <=39, '30 - 39',if(Age>=40 and Age<=59, '40- 59',if(Age>=60 and Age<=79, '60 - 79','80 Above')))))
You can use the above field as dimension in the chart and get the desired output.
-Haneesh
Haneesh's Script will perfectly working. I used Same logic in Finance Application
hello haneesh,
thank you for your reply,
but, where did i type this syntax?
if(Age<20,'Under 19',if(Age>=20 and Age<=29,'20-29',if( Age>=30 and Age <=39, '30 - 39',if(Age>=40 and Age<=59, '40- 59',if(Age>=60 and Age<=79, '60 - 79','80 Above')))))
in 'edit script' or in field expression, or where??
hello sunin, where must i type that script?
Dear Friend,
There are two way to write this script
1) In Experession of Chart
2) Script Level
I will suggest you to write at Script Level.
In the script - in the same "Load" statement where you load the Age dimension
Hi,
You should include this expression in the load statement where you load the Age field.
-Haneesh