Discussion board where members can get started with QlikView.
I want to create a age group in script.
I have a date field like OpenDate
so I want to create
as Agegroup this as dimension I want to use in chart.
can anyone help on this?
Go to Solution.
If ( Date(Today()) - Date(Date_Field) ) <= 30, '0-30',
If ( Date(Today()) - Date(Date_Field) ) >= 31 and Date(Today()) - Date(Date_Field) <60, '31-60',
If ( Date(Today()) - Date(Date_Field) ) >= 61 and Date(Today()) - Date(Date_Field) <90, '61-90' ,
If ( Date(Today()) - Date(Date_Field) ) >= 91 and Date(Today()) - Date(Date_Field) <120, '91-120', '120+' )) ) ) as Days_Filter
View solution in original post
Why can't you use Age() directly in your script? May be Buckets
Use the Class function to create the groups.
For more help, follow below Qlik threads,
Maybe you can use this function
Intervalmatch, with this you can create numeric intervals and check were one line is allocated.
done this way working fine
if(Opendate>0 and Opendate<=30,Dual('1-30',2),
if(Opendate>30 and Opendate<=60,Dual('31-60',3),
if(Opendate>60 and Opendate<=90,Dual('61-90',4),
if(Opendate>90 and Opendate<=120,Dual('91-120',5),
if(Opendate>120,Dual('> 120',6)))))) as agegroup;