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

running-total() loses sort in query reference or join

Started by hespora, 06 Nov 2019 11:43:51 AM

Previous topic - Next topic

hespora

Hi there,


situation: simple query with one dimension, one measure coming from my source. In the query, the measure's sort property is set to "sort descending", and a query calculation of

running-total(
  [measure]
  for report
)

is correctly determining the running total, starting with the highest values.

My problem: I do not actually need the running total in this query, but I need to join it to a different query. However, when I do that, the sort order is ignored. Same happens when I just point a query reference to the query where I'm determining the running total.

Why is that? And how can I force cognos to use the sorting as specified in the original query?

hespora

I've looked at the generated sql for both queries. The original query quite correctly is built as

SUM("Measure")
  OVER(
    ORDER BY
      "Measure" DESC
  ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS "running total"


On the other hand, when I look at the referencing query, the same snippet becomes

SUM("Measure")
  OVER(
    ORDER BY
      100 ASC
  ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS "running total"



Andrei I

Can you reproduce this issue using Cognos Cloud and share your Report XML?