If you are unable to create a new account, please email support@bspsoftware.com

 

[SOLVED] Populating a field value with the value from another prompt?

Started by aerick911, 07 May 2014 03:54:27 PM

Previous topic - Next topic

aerick911

Hello All!

I'm having an issue in a report studio report based off of a cube.  I am using this report to be used as an prompted report and also have the ability to schedule it without having to enter in a reference period  (I'm using the current period)

I have a parameter called "Reference Pd" in a report that a user selects such as  [2014/Jan].

We would like to start scheduling this report and populate the reference period with the Current Period set within the cube IF a "Scheduled" prompt is selected as "YES", if it isn't then the report run with whatever the user selects as a reference period.
______

I have created another query using a linkedmember for the "Current Month".  Which seems to be working fine.

When an admin schedules this report, I have added in a line that asks if the report is scheduled and it will only display if the user is in a specific security group.   "Is this report scheduled?  Yes or No.  (the default is no).

I then have a hidden prompt page which sets the ?Reference Pd? date dependent on whether the report is scheduled or not with a little javascript and then use this query field below to populate ?Reference Pd?.

case when ?Schedule? = 'Yes' then linkMember(firstChild(rootMember([Invoice Cube].[Date].[Current Month])),[Invoice Cube].[Date].[Date]) else
?Reference Pd? end 

It's the "Else" part that is screwing me up.  How do you tell the report to just use the value that was previously given in the previous prompt page as long as the "Scheduled" prompt value <> 'Yes'?  The user selects the "reference pd" in the previous prompt page.





CognosPaul

Case statements generally don't work as expected in an OLAP environment.

In the query, make two additional data items, [Current Month] and [Reference pd].

Instead of the case statement, you could do something like:\

#
sb(substitute('Yes','Current Month',substitute('No','Reference pd',prompt('Schedule','token','No'))))
#

The data item's expression would then be either [Current Month] or [Reference pd] as needed.

aerick911

Thank You Paul,

Sorry it took so long to get back to you.  This worked perfectly, thank you so much for being an incredible assett to the Cognos community!