COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: jessimica602 on 23 Sep 2020 10:17:40 AM

Title: Prompt for a non-package item?
Post by: jessimica602 on 23 Sep 2020 10:17:40 AM
Hey all,

I am needing a prompt for a non-package item. So what I need to happen: when you run the report you get a prompt that asks head of household with a yes or no drop down list. The answer is what will hopefully trigger which calculation is going to be used in one of the fields.
I can't seem to figure out how to add a prompt that asks this, I have tried adding a field that had 'Yes'or'No', clearly didn't work but it was a shot in the dark.
Anyone know if this is a possibility?

Thank you!
Title: Re: Prompt for a non-package item?
Post by: seb24c on 24 Sep 2020 07:54:52 AM
Create a value prompt on your page with no filter or query. Set the static choices (in properties) to Yes and No.

Then add the prompt to your calculated field like:

if ( ?p_HeadOfHousehold? = 'Yes' ) then ( this calculation ) else ( this other calculation )

It will have to be a required prompt if you do it this way, otherwise you'd have to use a macro in your calculated field which is a little more complicated.

Edit: Forgot the ?s around the prompt.
Title: Re: Prompt for a non-package item?
Post by: jessimica602 on 24 Sep 2020 04:38:27 PM
This worked perfectly! Thank you!
Title: Re: Prompt for a non-package item?
Post by: seb24c on 25 Sep 2020 07:04:07 AM
Great! Happy to help!