Quantcast
Channel: SCN : Unanswered Discussions - SAP Crystal Reports
Viewing all articles
Browse latest Browse all 4814

Cross-Tab: Creating Age ranges in Columns

$
0
0

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-1011-1516-20All Clients (TOTAL)
ADHD325055
Mood Disorder NOS012526
PTSD151218

Viewing all articles
Browse latest Browse all 4814

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>