If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Recent posts

#1
Reporting / Re: Need help with a predictab...
Last post by dougp - Yesterday at 06:19:58 PM
sample input and desired output please
#2
Reporting / Re: Need help with a predictab...
Last post by FerdH4 - Yesterday at 11:40:16 AM
The XML worked beautifully right out of the box. 

Unfortunately, while testing with a larger dataset I found that the Rules can rarely be plural - I guess that's why they are "Rules" with an "s" on the end.  Here is the one example I've found so far:

[ Rules Fired : Daily credit @west (match), Daily credit @west (select), Daily redit@clay (match), Daily credit@clay (select), Daily credit@clay (sort) ]

It appears to have two occurrences of "(match)" and still only a single "(sort)".  My preference would be to just not try to parse those specific Rules.

Any idea for how I might easily adjust your five-part expression to just fully exclude like records from being processed through the rest of the expression?  Can you think of an IF condition what would easily identify the occurs of TWO "(match)" statements within a single field?



#3
Reporting / Re: Need help with a predictab...
Last post by FerdH4 - Yesterday at 11:06:06 AM
WHOA!  Actual XML code!  Thanks.

I'll test this very soon.  I'll post another Comment if there are any complications.  So please accept this "Thanks" dougp now in case I don't make it back for awhile.
#4
Reporting / Re: Need help with a predictab...
Last post by dougp - Yesterday at 10:09:02 AM
Here's a report spec that breaks down the pieces.  You'll still need to verify this against your values to be sure the end conditions are correct.  You'll also want to consider what happens if the value doesn't contain '(match)' or '(sort)' or both.

There may also be a slick way to accomplish this using regular expressions, but since support varies across database platforms, I thought it would be best to keep this simple.

This was created using Cognos Analytics 12.0.4FP1, so you will need to change the xmlns value to match what 11.2.3 produces.

<report xmlns="http://developer.cognos.com/schemas/report/17.2/" useStyleVersion="11.6" expressionLocale="en-us">
    <drillBehavior/>
    <layouts>
        <layout>
            <reportPages>
                <page name="Page1">
                    <style>
                        <defaultStyles>
                            <defaultStyle refStyle="pg"/>
                        </defaultStyles>
                    </style>
                    <pageBody>
                        <style>
                            <defaultStyles>
                                <defaultStyle refStyle="pb"/>
                            </defaultStyles>
                        </style>
                        <contents>
                            <list horizontalPagination="true" name="List1" refQuery="Query1">
                                <noDataHandler>
                                    <contents>
                                        <block>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <staticValue>No Data Available</staticValue>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                            <style>
                                                <CSS value="padding:16px;"/>
                                            </style>
                                        </block>
                                    </contents>
                                </noDataHandler>
                                <style>
                                    <CSS value="border-collapse:collapse"/>
                                    <defaultStyles>
                                        <defaultStyle refStyle="ls"/>
                                    </defaultStyles>
                                </style>
                                <listColumns>
                                    <listColumn>
                                        <listColumnTitle>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lt"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemLabel refDataItem="Assigning Rule"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnTitle>
                                        <listColumnBody>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lm"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemValue refDataItem="Assigning Rule"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnBody>
                                    </listColumn>
                                    <listColumn>
                                        <listColumnTitle>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lt"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemLabel refDataItem="loc match"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnTitle>
                                        <listColumnBody>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lm"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemValue refDataItem="loc match"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnBody>
                                    </listColumn>
                                    <listColumn>
                                        <listColumnTitle>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lt"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemLabel refDataItem="loc sort"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnTitle>
                                        <listColumnBody>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lm"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemValue refDataItem="loc sort"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnBody>
                                    </listColumn>
                                    <listColumn>
                                        <listColumnTitle>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lt"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemLabel refDataItem="before"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnTitle>
                                        <listColumnBody>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lm"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemValue refDataItem="before"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnBody>
                                    </listColumn>
                                    <listColumn>
                                        <listColumnTitle>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lt"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemLabel refDataItem="after"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnTitle>
                                        <listColumnBody>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lm"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemValue refDataItem="after"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnBody>
                                    </listColumn>
                                    <listColumn>
                                        <listColumnTitle>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lt"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemLabel refDataItem="output"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnTitle>
                                        <listColumnBody>
                                            <style>
                                                <defaultStyles>
                                                    <defaultStyle refStyle="lm"/>
                                                </defaultStyles>
                                            </style>
                                            <contents>
                                                <textItem>
                                                    <dataSource>
                                                        <dataItemValue refDataItem="output"/>
                                                    </dataSource>
                                                </textItem>
                                            </contents>
                                        </listColumnBody>
                                    </listColumn>
                                </listColumns>
                            </list>
                        </contents>
                    </pageBody>
                    <XMLAttributes>
                        <XMLAttribute output="no" name="RS_legacyDrillDown" value="0"/>
                    </XMLAttributes>
                </page>
            </reportPages>
        </layout>
    </layouts>
    <XMLAttributes>
        <XMLAttribute output="no" name="RS_CreateExtendedDataItems" value="true"/>
        <XMLAttribute output="no" name="listSeparator" value=","/>
        <XMLAttribute output="no" name="decimalSeparator" value="."/>
        <XMLAttribute output="no" name="RS_modelModificationTime" value="2015-11-25T21:38:24.820Z"/>
    </XMLAttributes>
    <queries>
        <query name="Query1">
            <source>
                <model/>
            </source>
            <selection>
                <dataItem name="Assigning Rule">
                    <expression>&apos;[ Rules Fired : General STAT (match), General STAT (select), General STAT (sort) ]&apos;</expression>
                    <XMLAttributes>
                        <XMLAttribute output="no" name="RS_dataType" value="3"/>
                        <XMLAttribute output="no" name="RS_dataUsage" value=""/>
                    </XMLAttributes>
                </dataItem>
                <dataItem name="loc match">
                    <expression>position (&apos;(match)&apos;, [Assigning Rule])</expression>
                    <XMLAttributes>
                        <XMLAttribute output="no" name="RS_dataType" value="1"/>
                        <XMLAttribute output="no" name="RS_dataUsage" value=""/>
                    </XMLAttributes>
                </dataItem>
                <dataItem name="loc sort">
                    <expression>position(&apos;(sort)&apos;, [Assigning Rule])</expression>
                    <XMLAttributes>
                        <XMLAttribute output="no" name="RS_dataType" value="1"/>
                        <XMLAttribute output="no" name="RS_dataUsage" value=""/>
                    </XMLAttributes>
                </dataItem>
                <dataItem name="before">
                    <expression>substring ([Assigning Rule], 1, [loc match] - 1)</expression>
                    <XMLAttributes>
                        <XMLAttribute output="no" name="RS_dataType" value="3"/>
                        <XMLAttribute output="no" name="RS_dataUsage" value="0"/>
                    </XMLAttributes>
                </dataItem>
                <dataItem name="after">
                    <expression>substring ([Assigning Rule], [loc sort] + 6)</expression>
                    <XMLAttributes>
                        <XMLAttribute output="no" name="RS_dataType" value="3"/>
                        <XMLAttribute output="no" name="RS_dataUsage" value="0"/>
                    </XMLAttributes>
                </dataItem>
                <dataItem name="output">
                    <expression>[before] || [after]</expression>
                    <XMLAttributes>
                        <XMLAttribute output="no" name="RS_dataType" value="3"/>
                        <XMLAttribute output="no" name="RS_dataUsage" value="0"/>
                    </XMLAttributes>
                </dataItem>
            </selection>
        </query>
    </queries>
    <modelPath>/content/folder[@name=&apos;Samples&apos;]/folder[@name=&apos;Models&apos;]/package[@name=&apos;GO sales (query)&apos;]/model[@name=&apos;model&apos;]</modelPath>
</report>
#5
Reporting / Need help with a predictable b...
Last post by FerdH4 - Yesterday at 08:54:28 AM
HAPPY NEW YEARS COGNOISe!

Using Cognos Analytics v11.2.3, I'm working with a text field named "Assigning Rule" which contains some repeating, useless characters as shown (between quotes) in actual example immediately below. 

"[ Rules Fired : General STAT (match), General STAT (select), General STAT (sort) ]"

I know how to use REPLACE to successfully carveout parts of the text like just the "(match)" or just the "(sort)". But that still leaves me with the text that lies between those two points.  I'm trying to craft an expression which will replace all the text starting from "(match)" through to "(sort)" with a single blank space.

In the original example above, the text to be blanked out is all of this:

" (match), General STAT (select), General STAT (sort) "

The end results after the expression is applied should look like this:

"[ Rules Fired : General STAT ]"

There are two complexities with this field in that the text between the "(match)" and "(sort)" points is both hugely variable text which is also of varying length.  The "(match)" and "(sort)" beginning and ending points are constants.

I'd appreciate any help with crafting a related replacement or substitution expression.

Thanks!
#6
 
The variety of payment methods available is another important factor. A good casino should support multiple options like credit cards, e-wallets, and cryptocurrency. Fast and secure transactions make the whole experience much smoother.
 
To see these principles in action, take a look at this detailed review: explore the best slot machines.
 
Hopefully, this information helps you make a better choice. Stay safe and play smart.
#7
Reporting / Re: Can author influence seque...
Last post by dougp - 15 Dec 2025 10:20:30 AM
QuoteI usually control the filters by writing my own SQL. Inner query and outer query, that way you can apply filters to inner query before applying to outer query
That's always a good double-check.  So if you write custom SQL for this, you get different results than what Cognos is producing?  Cognos is just generating SQL for you based on what you have created in Reporting combined with the way the model was defined.  So what's different between the SQL that Cognos is generating and the SQL that you wrote that produced the result you wanted?  Did you make a mistake in the report?  Is there an incorrect relationship in the model?  ...?


Your original question was about the order of filters.  Now it's about the order of subqueries.

That can be done by chaining multiple queries together.  Create Query1.  Use Query1 as the source for Query2.  etc.  If you're using CQM Cognos will write an old-style query using subqueries in the FROM clause.  If you are using DQM, Cognos will write exactly the same query, but using CTEs.

While one of the following queries may return faster, they will return exactly the same results.

with
Query1 as (
select col1, col2
from MySource
where col1 = 1
)
select col1, col2
from Query1
where col2 = 2
;

with
Query1 as (
select col1, col2
from MySource
where col2 = 2
)
select col1, col2
from Query1
where col1 = 1
;

select col1, col2
from MySource
where col1 = 1
  and col2 = 2
;








#8
Reporting / Re: Can author influence seque...
Last post by cognostechie - 12 Dec 2025 12:53:04 PM
Quote from: FerdH4 on 10 Dec 2025 02:58:29 PMI'm working with v11.2.3 and getting unexpected results (result set) in a query with nine Detail Filters.

I've successfully tested each filter alone and get the correct result set each time.  Even when 6, 7, or even 8 Filters are active, the result sets are correct.

But I get wrong result set when all nine Filters are active.  Records which should not be excluded are being excluded even though they were not excluded in earlier tests with fewer than 9 Filters active. 

I am using Minimum and Maximum expressions on separate fields in separate Filters.  Quite literally, it looks like if I could control the other of the execution of one or specific Filters the results might be correct.

Is there anything that I can do inside of a single Query to influence the execution order of my Filters?

I usually control the filters by writing my own SQL. Inner query and outer query, that way you can apply filters to inner query before applying to outer query
#9
AI Agents and Automation / Cognos AI Agents - Has anyone ...
Last post by DaBaker - 12 Dec 2025 11:47:17 AM
AI agents automate content validation, track unused reports, monitor performance, and even assist with migration projects.

By offloading routine work to AI driven processes, BI professionals can spend more time on strategic analysis, data storytelling, and partnering with business stakeholders. Automation is not about replacing BI teams. It is about elevating them to higher value work.

Anyone us the AI Agents built for Cognos?  How has it gone?
#10
AI Readiness for BI Teams / Anyone using AI within Cognos ...
Last post by DaBaker - 12 Dec 2025 11:45:13 AM
AI adoption does not start with models. It starts with the foundation of your BI environment. Teams preparing for AI should focus on improving data quality, tightening governance, cleaning redundant objects, and upgrading to Cognos 12 to ensure performance and security.

An AI ready environment has clear data lineage, consistent metadata, modern security, and scalable infrastructure. These steps reduce the risk of misleading predictions, increase trust, and make migration to AI enhanced tools like Watsonx BI far smoother.

Anyone have some real examples of using AI with Cognos, that isn't WxBI or what is built inside Cognos?