COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: tgs728 on 23 Feb 2017 12:02:17 AM

Title: Displaying Week and Mindate and max date in a list report for DMR
Post by: tgs728 on 23 Feb 2017 12:02:17 AM
Hi All,

I have a cube based report.
Time dimension -> Year ,
weekofYearDate

Title: Re: Displaying Week and Mindate and max date in a list report for DMR
Post by: tgs728 on 23 Feb 2017 12:05:34 AM
Hi All,

I have a cube based report.
Time dimension -> Year
                              weekofYearDate
                              Date
In list report i need to show as per below can any one help me on this.



Week of year   MIndate            Max date
Wk-1               01-01-2017     07-01-2017
wk-2                08-01-2017     14-01-2017
Title: Cognos DMR time Dimension display in the list
Post by: tgs728 on 23 Feb 2017 12:22:19 AM
Hi All,

I have a cube based report.
Time dimension -> Year
                              weekofYearDate
                              Date
In list report i need to show as per below can any one help me on this.

Week of year   Mindate            Max date
Wk-1               01-01-2017     07-01-2017
wk-2                08-01-2017     14-01-2017
Title: Re: Cognos DMR time Dimension display in the list
Post by: Deep750 on 23 Feb 2017 05:08:12 AM
If it is in the same hiearachy, and date is on the level below week, you can use lastChild() and firstChild-function.
These functions will pick the first and last child of the week.
Title: Re: Cognos DMR time Dimension display in the list
Post by: CognosPaul on 23 Feb 2017 09:03:49 AM
if you try to use first and last child in a list, you'll get no results. Essentially you'll be doing something like:

select date from table where date = '2017-01-08' and date = '2017-01-14'

You could do something like wrapping roleValue('_memberCaption',) around the first and last child, but that's ugly.

Instead, why not go back to the model and add "week start" and "week end" dates as attributes? That way you won't have any issues with conflicting family members.