COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Joz on 20 Jan 2016 08:23:46 AM

Title: Getting attribute of one dimension from prompt of another
Post by: Joz on 20 Jan 2016 08:23:46 AM
Hi all,

I have a report with a prompt "Version", those are like "Winter_2015"
I need to get from "Year" dimension, the attribute matching with version's year.

The problem is I can not use in Cognos Macro, neither susbtring or dataitem reference.
I manage to replace first caracters with substitute function, but I am forced to put first part directly which I'd like to avoid:

#substitute( '\[cube\]\.\[dimension2\]\.\[Hierarchy2\]->:\[TM\]\.\[dimension2\]\.\[Hierarchy2\]\.\[@MEMBER\]\.'  ; '' ;
'[cube].[dimension1].[Hierarchy1].'+  substitute( 'Winter_' ; '' ; prompt( 'pVersion' ; 'token' ) )  )#


Any idea?