COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: jsavs on 16 May 2016 03:37:25 PM

Title: Concatenating multiple paramaters to be used as a filter
Post by: jsavs on 16 May 2016 03:37:25 PM
Hello all,

I've got a request that is leaving me scratching my head.  User is requesting to see three drop down lists each with single character values to choose from (minimum of two columns must be selected). The values chosen  from these drop down lists must then be combined to form a specific code which will be used as a filter for his report.

I've created the drop down lists and populated them with static choices, but I'm unsure where to go from here. Initially I went in blind and tried things such as simply adding three parameters together in an advanced filter and setting it to equal the column, things like that.

I apologize if this is a very mundane question as I am relatively new to Cognos, I've googled for a couple hours and I haven't been able to find anything.

Thank you.
Title: Re: Concatenating multiple paramaters to be used as a filter
Post by: HalfBloodPrince on 17 May 2016 01:17:40 AM
could you please provide more information with an example ?
Title: Re: Concatenating multiple paramaters to be used as a filter
Post by: BigChris on 17 May 2016 02:03:52 AM
How many characters are there in each of your prompts? Lets says that there are 5 in the 1st, 4 in the 2nd and 3 in the 3rd...that will give you 5 * 4 * 3 = 60 combinations...are you going to filter for all 60 of those? And if NULL is a valid selection on those, then then the numbers go up again 6 * 5 * 4 = 120.
Title: Re: Concatenating multiple paramaters to be used as a filter
Post by: jsavs on 17 May 2016 10:40:03 AM
Hey there, thanks for the replies.

So as an example, there will be three dropdown lists each with the same options to choose from (e.g. numbers from 0-9).

So let's say a user chooses from each dropdown the following choices: 4, 5, and 0. This then corresponds to a specific 450 code.

Ultimately what I have to do is filter a column on code 450, a concatenation of the three choices available from the dropdown lists.

I know what you're thinking by this point and, no ,business does not want to key in by hand into a textbox =(
Title: Re: Concatenating multiple paramaters to be used as a filter
Post by: BigChris on 18 May 2016 02:12:43 AM
Ahh...the mists are clearing a bit now. It sounds like you're just looking to filter your column using the three prompts. I'm guessing you just need a detail filter that looks something like

[YourField] = ?Prompt1? || ?Prompt2? || ?Prompt3?
Title: Re: Concatenating multiple paramaters to be used as a filter
Post by: Lynn on 18 May 2016 02:14:23 AM
Presumably this is a relational package?

Building on Chris' answer, if it is a number then take the separate figures and compute the appropriate integer.


[Your Column] = ( ?Choice1? * 100 ) + ( ?Choice2 * 10 ) + ?Choice3?


Sounds like a horrible user interface but wouldn't be the first time a user specified something absurd  ;)
Title: Re: Concatenating multiple paramaters to be used as a filter
Post by: jsavs on 18 May 2016 10:14:42 AM
Big Chris and Lynn, thank you guys!!

You've pointed me in the right direction and I've been able to create a working solution.