COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: suhas_bhat on 19 Jan 2014 09:50:15 PM

Title: How to have multiple values in a single data item
Post by: suhas_bhat on 19 Jan 2014 09:50:15 PM
Hi All,
    I have a column in the database called month number which would hold values 1-12. Currently it has only one value as it is still January. My requirement is to display whatever value corrsponds to Jan and to also display 0s for Feb-Dec. How is this possible?

Is there any way to create a data item with more than one value? Can i hardcode Jan-Dec values so that they open up when pulled as a crosstab column? Then i can put a condition in my measure to check against the col values and show 0 where ever there is no data. Any suggestions?

Thanks
Title: Re: How to have multiple values in a single data item
Post by: suhas_bhat on 21 Jan 2014 07:06:58 AM
Hi All,
   The solution to this would be to maintain 12 separate queries, each with hard coded values for month eg: Jan,Feb,Mar.
Then Union all these queries to get one data item with all 12 values. This would give 13 queries in total. If there is any easier way using functions etc. pls let me know.. Can we use some set function etc. to make a set?
Title: Re: How to have multiple values in a single data item
Post by: MFGF on 21 Jan 2014 09:13:58 AM
If you are using a dimensional package you could bring in the individual month members (or tuples). Otherwise, with a relational package, multiple queries (as you suggested) are the way to go.

Cheers!

MF.