Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to create a age group in script.
I have a date field like OpenDate
so I want to create
0-30
31-60
61-90
91-120
120+
as Agegroup this as dimension I want to use in chart.
can anyone help on this?
Try This,
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
Why can't you use Age() directly in your script? May be Buckets
Hi Sony,
Use the Class function to create the groups.
For more help, follow below Qlik threads,
Thanks,
Venkata Sreekanth
Hi,
Maybe you can use this function
Intervalmatch, with this you can create numeric intervals and check were one line is allocated.
Regards
Try This,
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
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;