COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: dire on 03 Nov 2015 06:21:53 PM

Title: Keywords, Prompts, and Keyword Matches
Post by: dire on 03 Nov 2015 06:21:53 PM
Lurker here, and I have registered today to pose a unique problem concerning keywords that I have yet to find a solution for. I've searched for a solution to no avail.

My goal is to:


Currently, I have implemented the following:

Detail Filter:

[SQL1].[DESCRIPTION] is null or
[SQL1].[DESCRIPTION] contains ('%KEYWORD1%') or
[SQL1].[DESCRIPTION] contains ('%KEYWORD2%') or
[SQL1].[EXPENSE_CITY] is null or
[SQL1].[EXPENSE_CITY] contains ('%KEYWORD1%') or
[SQL1].[EXPENSE_CITY] contains ('%KEYWORD2%') or
[SQL1].[EXPENSE_COUNTRY] is null or
[SQL1].[EXPENSE_COUNTRY] contains ('%KEYWORD1%') or
[SQL1].[EXPENSE_COUNTRY] contains ('%KEYWORD2%')


[Description MATCH] data item (and similar setup for [Expense Country MATCH] and [Expense City Match] data items):

case
when [SQL1].[DESCRIPTION] is null then '(BLANK)'
when [SQL1].[DESCRIPTION] contains ('%KEYWORD1%') then 'KEYWORD1'
when [SQL1].[DESCRIPTION] contains ('%KEYWORD2%') then 'KEYWORD2'
end


There are a couple observations that should be noted:
Title: Re: Keywords, Prompts, and Keyword Matches
Post by: dire on 09 Nov 2015 03:57:13 PM
A single, hopeful bump.  :)
Title: Re: Keywords, Prompts, and Keyword Matches
Post by: Lynn on 10 Nov 2015 02:16:16 AM
Instead of a single parameter accepting multiple keywords how about a fixed number of parameters each accepting a keyword. All but one could be optional. Not necessarily elegant but might be better than hard coding.

Title: Re: Keywords, Prompts, and Keyword Matches
Post by: BigChris on 10 Nov 2015 03:18:31 AM
Can you use wildcards in your search? The reason for asking is that I was thinking you could concatenate your fields into one field, then you could perhaps filter along the lines of:

[ConcatenatedField] contains if(?Prompt1? is missing) then (%) else (?Prompt1?) or [ConcatenatedField] contains if(?Prompt2? is missing) then (%) else (?Prompt2?) ...
Title: Re: Keywords, Prompts, and Keyword Matches
Post by: dire on 11 Nov 2015 04:56:20 PM
Quote from: Lynn on 10 Nov 2015 02:16:16 AM
Instead of a single parameter accepting multiple keywords how about a fixed number of parameters each accepting a keyword. All but one could be optional. Not necessarily elegant but might be better than hard coding.

Thanks for the recommendation, Lynn! This would be awesome if we had a low amount of keywords, although we will be searching for a little above 400. :(

Quote from: BigChris on 10 Nov 2015 03:18:31 AM
Can you use wildcards in your search? The reason for asking is that I was thinking you could concatenate your fields into one field, then you could perhaps filter along the lines of:

[ConcatenatedField] contains if(?Prompt1? is missing) then (%) else (?Prompt1?) or [ConcatenatedField] contains if(?Prompt2? is missing) then (%) else (?Prompt2?) ...

Thanks for the recommendation, BigChris! I will check to see if I can work something like that to list multiple keywords into the match columns.
Title: Re: Keywords, Prompts, and Keyword Matches
Post by: dire on 04 Mar 2016 12:59:12 PM
Just wanted to add some closure to this post - I ended up hardcoding the keywords into a detail filter, as described in the original post.

Fortunately, any keywords would be updated quarterly, so it's not much of a headache. Hope this helps someone in the future.  ;)