COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: leahmarie on 09 May 2011 03:00:46 PM

Title: Using a Measure as a constant number in Calculated measures in a crosstab
Post by: leahmarie on 09 May 2011 03:00:46 PM
Ok so I am rather new to Cognos, I've only been using it for about 2 months, so if this is impossible or a silly question, I apologize in advance.

But basically I am creating a report that is supposed to be a replica of a p&l analysis with respect to budget in Cognos so that they can drill down to levels based on category.  The measures are obviously different based on each category, some are by day some are percents some are averages and some are just totals.  That all being said, my question is they want the per day cost based on Supplies, Food, and other.  The two measures I have are $ amt and Days.  I would normally just Divide the two or use a function as either a query calcualation or a calculated measure, but since it is a dimensional cube, there is no days data associated with Supplies, Food and other. So it just gives me divide by zero whenever it runs.  I have been trying to make the days information constant, by creating a data item, or singleton, but neither has worked.  The days data is just one number, but it will change based on which level and date they select in the prompt page before the report is ran otherwise I could just use the number itself.  Any help at all is appreciated!:)
Title: Re: Using a Measure as a constant number in Calculated measures in a crosstab
Post by: leahmarie on 20 May 2011 01:10:21 PM
I actually figured this one out myself, but in case anyone didn't know, all you have to do is use a tuple, which I didn't understand until just recently.  value(tuple( two measures where you want the intersection))
Title: Re: Using a Measure as a constant number in Calculated measures in a crosstab
Post by: barrysaab on 21 May 2011 04:30:19 AM
Thanks,leahmarie, for sharing the info.