COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: kgcognos on 22 Jan 2016 02:58:19 PM

Title: YTD set calculation not working
Post by: kgcognos on 22 Jan 2016 02:58:19 PM
Please help I don't understand why it won't calculate the YTD set when NOT selecting the current month:

Just to make it simple my report has 2 columns
Selected Day  and  YTD

The user is prompted to select a Month.  The default is the Current Month.

Selected Day Data Item contains below. Basically, if it is Current Month, set to curent fiscal day else, set to last day of fiscal month.
if ([Selected Month] =
linkmember( 
firstchild([Sales Cube].[Fiscal Time].[Curr Fisc Month].[Curr Fisc Month]->:[PC].[@MEMBER].[Current Month]), [Sales Cube].[Fiscal Time].[Fiscal Time].[Month])
)
then (linkmember(  firstchild( [Sales Cube].[Fiscal Time].[Last Fisc Day].[Last Fisc Day]->:[PC].[@MEMBER].[Curr Fisc Day]) , [Sales Cube US].[Fiscal Time].[Fiscal Time].[Work Day] ))
else (lastchild([Sales CubeS].[Fiscal Time].[Fiscal Time].[Month]->?pSelMonth?))

YTD  contains below:
total(currentMeasure within set [Curr YTD Set])

Curr YTD Set contains below:
periodsToDate([Sales Cube].[Fiscal Time].[Fiscal Time].[Year],[Selected Day])

When I run the report and select the Current Month, the Selected Day and YTD shows up correctly on the report. The Selected Day heading contains the caption of the current day of the Month.

When I run the report and select a different Month, the Selected Day  shows up correctly on the report but the YTD column does not show up. The Selected Day heading contains 'Selected Day' as heading.

Please help what am I missing. Thank you in advance.