Part 5 of 5 in a series on our Cognos Analytics 11.2.4 to 12.1.3 upgrade. Previous part: Framework Manager on Cognos 12: what changes when the model meets Dynamic Query Mode
After the server was up and the model was published, the daily work was reports. The same few filter mistakes showed up under different names. This post is those mistakes, and how we kept them in one git tree so the next report did not start from a blank page.
Why
A multi-select prompt that used to mean "all values" starts returning one value. A generated prompt page shows a long list oldest-first even though the query is newest-first. Both are Cognos 12 behaviours. Both are easy to "fix" in one report and miss in the next forty.
The goal
- Filters that still mean "all" when the user picks every value, or the ALL sentinel.
- A generated prompt that shows the newest value first.
- A repo layout someone new can read without sitting through the whole project.
Architecture, in one line
Each failed report gets a folder, a before-and-after expression, and a run on 12.1.3 before anyone edits the next report. The compatibility SQL and the Podman script live in the same tree.
Prerequisites
- Cognos Analytics 12.1.3.
- A backup copy of the report in the content store before you edit the live one. We name it with the date. The live report is what we change. The copy is only there to roll back.
- The native SQL when a filter fails.
Part 1: What we had to sort out
1. ?P? = 'ALL' does not mean what it meant
In 12 a multi-select prompt is an array. These are the forms that failed for us, and the forms we use now:
| Old filter |
What 12 did |
Filter we use |
?P? = 'ALL' |
XQE-GEN-0002, or only the first value |
'ALL' in ?P? |
?P? <> 'ALL' |
same family |
'ALL' not in ?P? |
column = ?P? on a multi-select |
one value |
column in (?P?) |
Search the specification for = 'ALL' and <> 'ALL' before you publish. We found leftovers in filters that were not the one we had just edited.
A long "select everything" URL blew past the browser limit. For that prompt we pass a single sentinel value meaning "all" instead of every id.
2. The generated prompt page sorts the list ascending
The query returned the values newest first. The SQL in the log had ORDER BY ... DESC. The generated prompt page painted them oldest first. An authored prompt page with its own sort was fine. A portal extension did nothing, because the prompt page is drawn in an iframe that loads webcontent/bi/pat/rsapp.htm. Extension scripts run in the portal window, not in that iframe.
We added a small script to rsapp.htm, and a matching change in prompting/properties.js for the classic viewer. The script reorders the list after Cognos has drawn it. Back up both IBM files first. A fix pack puts the originals back.
Two things that made the first patch look like it had failed:
- The gateway serves
webcontent from each application node. Patch every node, or half the users still see A–Z.
rsapp.htm and the JavaScript are cached hard. We only saw the new order in a private window, or after a cache-busting query string.
3. One report at a time, same prompts on both sides
We run the report on 12.1.3 first. If it fails, we do not run it on the old environment to "compare". There is nothing to compare yet. When it succeeds, we run the same prompts on 11.2.4 and look at figures, row order, and whether Excel still has one sheet per page set. PDF file size is a poor verdict. The 12.1 and 11.2 PDF engines paginate differently.
4. What the repository holds
The tree grew around the work, and it is now the thing we hand to someone who was not in the room:
- versioned SQL for the compatibility schema, plus the script that rebuilds it from whatever tables the warehouse has today
- the Podman control script and the env-file pattern, without passwords
- one folder per report we changed: the error, the expression before, the expression after, the run result
- Framework Manager notes: data source names,
currentSchema, publish order
- a short project readme that says 11.2.4 to 12.1.3, DB2 to PostgreSQL, and which error code meant which fix
The git remote is private. The layout is the part worth copying. A new environment should be able to rebuild the compatibility schema from the SQL, start Cognos from the control script, and find the filter rule without reading a year of chat.
5. Where an assistant helped
We kept an AI assistant pointed at that same tree. It did not publish packages or decide that a figure was right. It was useful at the boring edges: finding every = 'ALL' in a specification, drafting the ticket note in the same shape as the last one, and pulling the native SQL line out of a long log so we could see function year(date) does not exist again instead of starting a new theory.
The rule we stuck to: the assistant writes into the repo, the repo is what we re-read next week, and a report is fixed only when it has been run. A note that says "should work" is not a result. That is also why the error-code post exists as its own page. The assistant is only as good as the folder it can search.
Part 2: A filter change, briefly
Step 1. Copy the report in the content store. Name the copy with the date. Open the live report.
Step 2. Replace ?P? = 'ALL' with 'ALL' in ?P?, and ?P? <> 'ALL' with 'ALL' not in ?P?. For a multi-select that is not an ALL sentinel, use in (?P?).
Step 3. Save the live report. Run it with one value, then with several, then with ALL if you have that sentinel.
Step 4. If a list is oldest-first only on the generated prompt page, patch rsapp.htm on every gateway node and retest in a private window.
Step 5. Put the before and after in the repo next to the error code. The next report with the same filter should be a search, not an investigation.
-------------------------------------------------------
Anand kushwaha
https://www.linkedin.com/in/anandkushwaha064/
Senior Software Engineer
AMVARA CONSULTING S.L.
Barcelona
-------------------------------------------------------