COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gosoccer on 15 Sep 2015 09:34:40 AM

Title: YES or NO Selections by User and Using it As Parameters in a Query Filter
Post by: gosoccer on 15 Sep 2015 09:34:40 AM
Hey guys,

I have to have my main Query to include a "Y" or "N" condition to pullup a listing of certain Subject Query
values.

Like if they select "Y" in the Prompt Page Drop Down, the Query needs to go after only certain
CARS in White and if they select "N", it needs to go after All CARS or only the RED Ones.

Could you please help if you could.

Thx so much for your time, :) :)
Title: Re: YES or NO Selections by User and Using it As Parameters in a Query Filter
Post by: BigChris on 15 Sep 2015 10:06:29 AM
(?Prompt? = 'Y' and [Cars].[Colour] = 'White') or ?Prompt? = 'N'
Title: Re: YES or NO Selections by User and Using it As Parameters in a Query Filter
Post by: MFGF on 15 Sep 2015 10:30:10 AM
Quote from: gosoccer on 15 Sep 2015 09:34:40 AM
Hey guys,

I have to have my main Query to include a "Y" or "N" condition to pullup a listing of certain Subject Query
values.

Like if they select "Y" in the Prompt Page Drop Down, the Query needs to go after only certain
CARS in White and if they select "N", it needs to go after All CARS or only the RED Ones.

Could you please help if you could.

Thx so much for your time, :) :)

Hi,

You're not articulating the requirement very clearly here. What do you want to be returned if the users pick "N" from the prompt? All cars? Red cars? Some other choice?

Chris's solution will return all cars in that situation - but it's not clear from your post if this is your requirement?

MF.
Title: Re: YES or NO Selections by User and Using it As Parameters in a Query Filter
Post by: gosoccer on 15 Sep 2015 11:41:42 AM
Sorry about that.

If the value returned from the prompt = 'Y', have the Query to go after only CARS with IDs (1-3) and return only
those cars, else have the Query to go after All cars.

So, something like this:

if (?prompt? in ('1','2','3') )
then return cars with ID# 1 or 2 or 3
else return all



Thx alot
Title: Re: YES or NO Selections by User and Using it As Parameters in a Query Filter
Post by: gosoccer on 15 Sep 2015 12:21:50 PM
 :) :) :) YES, Chris. That is perfect!!!! it worked for what I was trying to simply filter based on
a user selection. Thx so muchhhhh    8) 8)