COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: philelmousse on 17 Sep 2011 03:07:24 AM

Title: issue with singleton
Post by: philelmousse on 17 Sep 2011 03:07:24 AM
Hello,

I have some trouble with a singleton.

I have a data item in a singleton. If the data item is like that : "total(currentMeasure within set [Dimension1])" It works.

But if I put that :

"total(currentMeasure within set [Dimension1])-total(currentMeasure within set [Dimension1],[Dimension2].[Member1]" the cell is blank

What is wrong ?
Title: Re: issue with singleton
Post by: CognosPaul on 18 Sep 2011 08:49:07 AM
It looks like you're trying to subtract Dim2.Member1 from the total.

Everything after the "within set" needs to be a set expression. Since Cognos doesn't support tupling sets, you need to put the tuple on something else.

currentMeasure can be part of a tuple:

total(tuple(currentMeasure,[Member]) within set [Data Item1])
Title: Re: issue with singleton
Post by: philelmousse on 18 Sep 2011 10:30:07 AM
Thanks for your answer.

Whats in your dataitem1 ?

What should be the complete expression to get the result of [DIMENSION1].[Category1] minus [DIMENSION2].[Member1] for measure [cost_monthly_actuals] ?

I wrote :

total(tuple([cost_monthly_actuals],[DIMENSION1].[CATEGORY1]))-
total(tuple([cost_monthly_actuals],[DIMENSION2].[Member1]) within set[DIMENSION1].[CATEGORY1])

But the cell is blank



Title: Re: issue with singleton
Post by: CognosPaul on 18 Sep 2011 02:19:29 PM
The member summary total() needs to use set expressions.

total([value expression] within set [set expression])

The value expression can be a tuple, a measure, the currentMeasure function, or even a static value. The set expression can be any expression that returns a set of members. Examples being, children([2011]) or set([2009],[2010],[2011]) or [Cube].[Dim].[Level].

Are you using a dimensional datasource or a relational datasource?
Title: Re: issue with singleton
Post by: philelmousse on 18 Sep 2011 02:53:24 PM
Hello,

My model is a DMR.

I use set expression but when I use two expression in my singleton its not working... And if I use that in the main query it works...
Title: Re: issue with singleton
Post by: philelmousse on 21 Sep 2011 02:58:42 AM
nobody knows ? :/
Title: Re: issue with singleton
Post by: CognosPaul on 21 Sep 2011 06:31:24 AM
Can you post the full expression?

I'll try to post an example next time I'm at a client that has the samples.
Title: Re: issue with singleton
Post by: philelmousse on 21 Sep 2011 09:46:53 AM
someone of a support team in my company resolved the problem.

He wrote one data item :

completeTuple([dimension1].[member1],[cost_monthly_actuals])

and the other :

TUPLE([dimension1].[member1],[dimension2].[member1],[cost_monthly_actuals])

and the result :

[dataitem1]-[dataitem2]
Title: Re: issue with singleton
Post by: philelmousse on 22 Sep 2011 03:46:31 AM
it works  :)