COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: srinu_anu2007 on 23 Aug 2012 07:08:20 AM

Title: Age Band
Post by: srinu_anu2007 on 23 Aug 2012 07:08:20 AM
Hi

i want to display the age like below, what function i will use to display like below, is it possible? can any one share your valuable ideas.


Age Range of the Member (<1,1,2-6,7-13...)
Title: Re: Age Band
Post by: HalfBloodPrince on 23 Aug 2012 07:31:36 AM
How many Total age bands are there  like 2-3,7-6  up to what age ?
Title: Re: Age Band
Post by: tjohnson3050 on 23 Aug 2012 10:45:17 AM
Use case statement logic in a query item expression to transform the age into buckets with a text item:

case
when age < 1 then '< 1'
when age = 1 then '1'
when age >1 and age < 7 then '2 - 6'
...
end
Title: Re: Age Band
Post by: srinu_anu2007 on 23 Aug 2012 11:07:27 PM
i have ...65-69,70-79,80+ this is final age band
Title: Re: Age Band
Post by: srinu_anu2007 on 24 Aug 2012 04:03:13 AM
case statement is not working if you hv any different ways can u post.
Title: Re: Age Band
Post by: HalfBloodPrince on 24 Aug 2012 04:53:15 AM
Try this

if([age]< 1) then
('<1')
else if([age ]=1 ) then
('1')
else if ([age] >1 and age < 7) then
( '2 - 6')
else if ([age] >7 and age < 14 ) then
( '7 - 13')
else if ([age] >70 and age <= 79) then
( '70-78')
else
('80+')