I have the following formula to convert DOB to age:
if //months (datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1))<2 then totext(datediff('mm',{CDCLIENT.DOB},currentdate),0,'') & ' months' else //years totext((datediff('yyyy',{CDCLIENT.DOB},currentdate)-(if datepart('y',currentdate)>datepart('y',{CDCLIENT.DOB}) then 0 else 1)),0,'') //& ' years'
Then I created a series of formula (sub-sets) to pre-define my age range
{@age) in "0" to "10"
and then other formulas for "11-15" and "16-20"
When I insert these in the cross-tab expert, columns it converts each formula into two Columns "True" and "False"
What's the best approach and formula when using a cross-tab? I want the following
0-10 | 11-15 | 16-20 | All Clients (TOTAL) | |
---|---|---|---|---|
ADHD | 3 | 2 | 50 | 55 |
Mood Disorder NOS | 0 | 1 | 25 | 26 |
PTSD | 1 | 5 | 12 | 18 |