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

Trying to Get ALL Singletons Calculating Properly

Started by Cognos_Jan2017, 05 Oct 2018 12:42:14 PM

Previous topic - Next topic

Cognos_Jan2017

Working w/ Singletons going to Table Cells.  Using Table as a Report.

The Goal is to ensure "Rates" are calculated from a Numerator and a Denominator.

Example, this Data Item will be part of a Numerator ...
Call it Data Item [AAA]
Case
When ([Query].[Month Begin Date] >=  Cast('2017-10-01',Date) and [Query].[Month End Date] <= Cast('2018-9-30',Date)) Then [Query].[Cases]
End

[AAA} is dragged into a Singleton where that Singleton has a Defined Data Property of [AAA]
Works fine with ...
Detail Aggregation = Total
Summary Aggregation = Default

The "Numerator" is a Data Item 'BBB' which is ...
[AAA]*200000
That is dragged in as a Singleton to a Table Cell, and works with ...
Detail Aggregation = Calculated
Summary Aggregation = Calculated
Its Singleton has a Data Property of [BBB]

A Data Item [CCC}, intended for the Denominator in the Rate calculation, is ...
Case
When ([Query].[Month Begin Date] >=  Cast('2017-10-01',Date) and [Query].[Month End Date] <= Cast('2018-9-30',Date)) Then [Query].[Hours]
End

[CCC} is dragged into a Singleton where that Singleton has a Defined Data Property of [CCC]

Here is where the Table goes berserk.
First [CCC] DOES appear w/ the Correct value with ...
Detail Aggregation = Total
Summary Aggregation = Default

BUT, previously working Singletons in the [AAA} entry row ALL change to 0
And [BBB] also turns to 0.
================================
Even changing [BBB] to ...
[AAA]*200000/[CCC]
... and keeping ...
Detail Aggregation = Calculated
Summary Aggregation = Calculated
CHANGES all other Singletons based on sample [Query] all turning to 0.

================================
Ideas on how to calculate a Correct Rate of [BBB]/{CCC}
WITHOUT turning other Singletons based on sample [Query] all turning to 0?

Please let me know if you have any questions.  Thank you, Bob

Lynn

It sounds like all the values are coming from the same query. Do you see correct information for all items if you look at tabular data or put them in a list? You can also associate your query to the page and then place the items anywhere you like on the page without using singletons.

Cognos_Jan2017

Thank you Lynn.  I am just getting up and will test thoroughly later today.

The Table will have up to 7 or 8 different queries.  No reason the Queries are not calculating correctly.

Associating Singletons from different Queries allows selecting Data Properties for each Singleton.  Do not know if more than one Query can be associated to a Page but will test.

Will report tests.  Thank you again.

Lynn

Quote from: Cognos_Jan2017 on 08 Oct 2018 06:46:40 AM
Thank you Lynn.  I am just getting up and will test thoroughly later today.

The Table will have up to 7 or 8 different queries.  No reason the Queries are not calculating correctly.

Associating Singletons from different Queries allows selecting Data Properties for each Singleton.  Do not know if more than one Query can be associated to a Page but will test.

Will report tests.  Thank you again.

You can only associate one query to a page.

It isn't clear why you need to set data properties for the singleton. You should look at the generated SQL to compare what changes when it works correctly vs not.

Cognos_Jan2017

Thank you Lynn.

Still at home.  Was afraid Page w/ one query limitation.

Am also setting Style Variable which did not work unless set singleton data property set.

Suspect need to find correct "mix" of aggregation settings to make Rate's numerator and denominator work properly.

Will continue testing when get to work, and report results here.

Cognos_Jan2017

Lynn - Just completed tests.  In all scenarios, "View tabular data" works fine.

To simplify, in addition to my first Post in this thread ..

Here are the test Data Items ...
GVV_DAW ... Expression ...
Case
When ([Query].[Month Begin Date] >=  Cast('2017-10-01',Date) and [Query].[Month End Date] <= Cast('2018-9-30',Date)) Then [Query].[Cases]
End

The Numerator for the needed Rate is ...
Num_Cases ... Expression ...
[GVV_DAW]*200000

The Denominator for the Rate is Den_Hours ... Expression ...
Case
When ([Query].[Month Begin Date] >=  Cast('2017-10-01',Date) and [Query].[Month End Date] <= Cast('2018-9-30',Date)) Then [Query].[Hours]
End

We are populating a Table w/ Singletons eventually thru as many as 5 to 7 different Queries.
The existing Table when populated by Singletons NOT calculating a "Rate" (Numerator/Denominator) works fine.

IF we drag in the test Numerator ONLY, which is Num_Cases ... Expression ...
[GVV_DAW]*200000
... ALL Singletons display correctly.

IF we change [Num_Cases] to ...
[GVV_DAW]*200000/[Den_Hours] then any Singleton from test [Query] changes to 0.

This occurs even if we assign Singleton Data Properities to the text item [Num_Case] for [Num_Cases] and optional [Cases], [GVV-DAW], [Den_Hours].

Surely this can be done?  Further thoughts from you please.  Thank you, Bob




Cognos_Jan2017

If only the Numerator of the "Rate calculation" is in a Singleton, it works fine ... AND ... works well if a Singleton Data Property is set for only the Data Item Name OR if NO Data Property is set for the Data Item Name.

I agree with you that a Singleton may NOT require setting a Data Property, but we had to when referring to a defined Slyle Variable.

Cognos_Jan2017

S O L U T I O N ...

Writing Data Items for Singletons WORKS FINE by having
many INDIVIDUAL queries utilizing Summary Filter(s) like ...
Count([Answer] for [Level 0 Name], [Level 1 Name], [Fiscal Year])

NOT sure that is the most efficient way, but it WORKS.

Hope managing MANY Cognos queries in their Query window doesn't
get too restricted.  Am optimistic it will be fine.