If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

bucket conept

Started by psandhya408, 29 Mar 2013 11:37:16 AM

Previous topic - Next topic

psandhya408

Hi I am new to cognos. I heard the word bucket in reports. Can anybody please explain me what is bucket and give me an example

Thanks in advance

calson33

I am also new to cognos, so I am not sure if it is a particular thing, but in general you "bucket" data into groups.

for example, if you had a table of people, and you wanted to report on their ages, you might "bucket" them into groups like
0-20
21-35
36-50
> 50

How you achieve that bucketing varies. There may be a way to do it in cognos, but I usually do it on the database side, using something like a case statement.


Select name, location,
case age when <=20 then 'BUCKET 1'
when between 21 and 35 then 'BUCKET 2'
etc.

hth
John

psandhya408


psandhya408

can any body help me to achieve this in cognos

bpothier

do you have a specific data set in mind - so we can be as specific as possible

psandhya408

Quote from: bpothier on 29 Mar 2013 02:24:40 PM
do you have a specific data set in mind - so we can be as specific as possible


I have to find the number of people who are ranging at different ages and I have only birthdate . How should i find the number of people in cognos using buckets.

Age 10-20 ,Age 21-30

cognostechie

The age is the difference between today's date and the DOB. Cognos has a function to determine today's date which is current_date. If you subtract the DOB from the current_date, you get the number of days. Convert that to years and you get the Age.

_Years_Between(current_date,[DOB])     --  will give you the age. Let's say you name is as Age.

Once you get this, you can create another data item which will create the buckets:

Case
   when (Age <= 10) then ('0-10')
   when (Age >10 and Age <= 20) then ('11-20')
   when ....
   else ...
Endcase

will give you the Age Group.