Have a simple matrix report that has columns values on age group values <16, 16-26, 26-65 and 65+
these display in incorrect order on report.
so I created another group called age order
when trunc((sysdate-cpi.birth_date)/365,0)<16 and cpi.gender_type = 'F'then '1' when trunc((sysdate-cpi.birth_date)/365,0)<16 and cpi.gender_type = 'M'then '2' when trunc((sysdate-cpi.birth_date)/365,0)>=16 and trunc((sysdate-cpi.birth_date)/365,0)<=26 and cpi.gender_type = 'F'then '3' when trunc((sysdate-cpi.birth_date)/365,0)>=16 and trunc((sysdate-cpi.birth_date)/365,0)<=26 and cpi.gender_type = 'M'then '4' when trunc((sysdate-cpi.birth_date)/365,0)>26 and trunc((sysdate-cpi.birth_date)/365,0)<65 and cpi.gender_type = 'F'then '5' when trunc((sysdate-cpi.birth_date)/365,0)>26 and trunc((sysdate-cpi.birth_date)/365,0)<65 and cpi.gender_type = 'M'then '6' when trunc((sysdate-cpi.birth_date)/365,0)>=65 and cpi.gender_type ='F'then '7' when trunc((sysdate-cpi.birth_date)/365,0)>=65 and cpi.gender_type ='M'then '8'
When I change the column groups matrix_AGE_GROUP to sort on the AGE_ORDER group I get an error.