COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: hespora on 21 Sep 2016 03:47:54 AM

Title: Techniques for passing "sets" of parameters?
Post by: hespora on 21 Sep 2016 03:47:54 AM
Hi there,


so I want to burst a report by ([Customer] AND [Business Unit]). Both Customer and Business Unit are available as fields, but I only want to run the report for specific sets. E.g., I want to run the report for (Customer 123 AND Business Unit ABC), and I want to run it for (Customer 456 AND Business Unit DEF).

If I just pass 123, 456 in a customer parameter and ABC, DEF in a Business unit parameter, the report would also run for (123 + DEF), and for (456 + ABC), however, I do not want those.

Anyone have any experience with passing sets of parameters to be run only in conjunction?


Thanks,
hespora.
Title: Re: Techniques for passing "sets" of parameters?
Post by: bdbits on 21 Sep 2016 04:18:29 PM
I must be missing something... sounds like a simple AND of the two parameters in a filter.
Title: Re: Techniques for passing "sets" of parameters?
Post by: hespora on 22 Sep 2016 02:00:48 AM
If I were to setup a filter like


[customer] in ?pCustomer? AND [BU] in ?pBU?


how would I control Cognos to only use those sets of parameters belonging together?
Title: Re: Techniques for passing "sets" of parameters?
Post by: Michael75 on 22 Sep 2016 02:13:37 AM
Something like this?

([customer] in ?pCustomer? AND [BU] in ?pBU?)
AND
(
([customer] = 123 AND [BU] = 'ABC')
OR
([customer] = 456 AND [BU] = 'DEF')
)
Title: Re: Techniques for passing "sets" of parameters?
Post by: hespora on 22 Sep 2016 02:20:21 AM
Well, the thing is, I cannot hardcode values - hence the need for parameters. I'm right now looking into building a field


[Customer] || ';' || [BU]

within the query and setting the parameter on that. Question, performance-wise, really is whether the SQL passes that to be done on database level, or if it's done within the query service.

I was just hoping that someone might have a different approach for the same problem.
Title: Re: Techniques for passing "sets" of parameters?
Post by: bdbits on 23 Sep 2016 03:34:31 PM
OK I think I did not follow you fully in the original post. Right now I am thinking perhaps you mean to restrict the user to specific combinations.

Michael75's approach might work there.

Or (thinking off the top of my head here), perhaps you could set up a prompt populated by a concatenation of the valid combinations?
So the user would pick from 'Customer A and 123', 'Customer B and 456', etc.
Then in the report, create the same concatenated data item and apply a filter to that.