COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: guthikv on 12 Jun 2013 09:33:47 AM

Title: maximum Date
Post by: guthikv on 12 Jun 2013 09:33:47 AM
Hello all,

Hope you can help me on this.

Currently I have list with around 10 columns. Of these 3 columns are critical that includes Order Number, Notes, Last Updated Date.
For every order there might be multiple notes updated and correspodingly a last Updated Date is recorded.

I would like to grab the last updated date and notes of every order number.

Please suggest what would be the best way to it.

Thanks in advance.
Title: Re: maximum Date
Post by: barrysaab on 12 Jun 2013 01:05:06 PM
Drag a data item and write an expression Max([Your Date]) ,I think that be it! Thanks
Title: Re: maximum Date
Post by: blom0344 on 12 Jun 2013 03:14:48 PM
A max([Date]) will be used within the context of other item brought in from the query, which, in case you bring in the note will yield all records, not the last one.

You will need a filter like [date] = max([date] for [ordernumber]) or something similar with after auto aggregate setting

[make note: classical BI issue, should be in top 10 of most questioned issues for my planned BI-basics Blog]
Title: Re: maximum Date
Post by: CognosPaul on 12 Jun 2013 03:37:51 PM
It's also worth mentioning that the correct way to solve it is by modifying the table and the loading process to make it into a SCD Type 6 (http://en.wikipedia.org/wiki/Slowly_changing_dimension#Type_6_.2F_hybrid). That way you can index on the flag field. The other ways would require more IOs on the table.