COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Corrigon on 02 Aug 2016 02:16:27 AM

Title: Constructing a MUN from a prompt macro
Post by: Corrigon on 02 Aug 2016 02:16:27 AM
Hi there. I am trying to use a prompt to construct an MUN. Prompt name is pBU. The MUN format is as below:

[GL Cube].[GLM Hierarchy - Set 2].[Consolidation 2]->:[M8].[[GLM Hierarchy - Set 2]].[Consolidation 2]].&[140A70]]]

I am trying to create a prompt for the 3-digit code in the last part of the MUN. The following is what I came up with, but I keep getting parsing errors:

#'[GL Cube].[GLM Hierarchy - Set 2].[Consolidation 2]->:[M8].[[GLM Hierarchy - Set 2]].[Consolidation 2]].&['+prompt('pBU', 'token')+'A70]]]'#

Can anyone please provide the correct syntax for this expression?

Thanks in advance,
Dave
Title: Re: Constructing a MUN from a prompt macro
Post by: MFGF on 02 Aug 2016 04:01:48 AM
Quote from: Corrigon on 02 Aug 2016 02:16:27 AM
Hi there. I am trying to use a prompt to construct an MUN. Prompt name is pBU. The MUN format is as below:

[GL Cube].[GLM Hierarchy - Set 2].[Consolidation 2]->:[M8].[[GLM Hierarchy - Set 2]].[Consolidation 2]].&[140A70]]]

I am trying to create a prompt for the 3-digit code in the last part of the MUN. The following is what I came up with, but I keep getting parsing errors:

#'[GL Cube].[GLM Hierarchy - Set 2].[Consolidation 2]->:[M8].[[GLM Hierarchy - Set 2]].[Consolidation 2]].&['+prompt('pBU', 'token')+'A70]]]'#

Can anyone please provide the correct syntax for this expression?

Thanks in advance,
Dave

Hi,

Does your MUN really have multiple brackets as above (ie [[ and ]]). This looks very odd to me. Have you tried right-clicking on the relevant member in the package tree and looking at the Properties page to check the MUN is correct?

As a sanity check, enclose the expression in an sq() function and display it in your report to see what is being generated

ie

#sq('[GL Cube].[GLM Hierarchy - Set 2].[Consolidation 2]->:[M8].[[GLM Hierarchy - Set 2]].[Consolidation 2]].&['+prompt('pBU', 'token')+'A70]]]')#

You can then compare this with the MUN you see in the Properties pane.

Cheers!

MF.
Title: Re: Constructing a MUN from a prompt macro (SOLVED)
Post by: Corrigon on 02 Aug 2016 06:20:45 PM
Hi MFGF, thanks so much for your reply.

It was while working through your suggestions that I realised I had TWO prompts call 'pBU'. I'd foolishly created the new one using the same prompt name as an existing prompt. So my original syntax on the expression was fine - I was just putting two sets of prompt information into it!

Thanks for your help, this is resolved now.