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: Date format in CSV
Last post by dougp - Yesterday at 01:51:15 PM
What's with the = and the quotes?  Are those needed in your CSV?

Quotenot working as expected for CSV
Not working for CSV?  Or not working for Excel?  Excel doesn't understand CSV files.  You might try looking at the result in a text editor.


Here's what I get using database-agnostic Cognos functions and operators:
                  cast(_year (current_date), varchar(4)) || '-' ||
substring('00' || cast(_month(current_date), varchar(2)), 1 + char_length(cast(_month(current_date), varchar(2))), 2) || '-' ||
substring('00' || cast(_day  (current_date), varchar(2)), 1 + char_length(cast(_day  (current_date), varchar(2))), 2)
#2
Reporting / Re: Date format in CSV
Last post by Good Friend - 15 Jan 2026 02:07:25 PM
Thanks again for spending time on this. Tried your logic but somehow it is not working as expected for CSV. I got a workaround for CSV with the below logic but when you export it to CSV you will have something like =" 2026-01-15 " and got to format it little bit to show it as 2026-01-15. Below is the Code

Code:
'=" ' + cast(extract(year, current_date), varchar(4)) + '-' +
(if (extract(month, current_date) < 10) then ('0') else ('')) + cast(extract(month, current_date), varchar(2)) + '-' +
(if (extract(day, current_date) < 10) then ('0') else ('')) + cast(extract(day, current_date), varchar(2)) + ' "'
#3
Reporting / Re: Date format in CSV
Last post by sjohnson - 15 Jan 2026 07:49:50 AM
Good Friend,
Sorry the code didn't work for you. 2041 is the sum of the year, month, and day. Any chance your code looks something like this?
_year(current_date)
+
_month(current_date)
+
_day(current_date)

If the date separators ('-') aren't included in the Data item expression then the result is evaluated mathematically since the '+' operator is being used for concatenation and all the parts are numeric.

If you replace '+' with '||' in the above code
_year(current_date)
||
_month(current_date)
||
_day(current_date)
then you should get '2026115'.

If you include the date separators in the original code above
_year(current_date)
+ '-' +
_month(current_date)
+ '-' +
_day(current_date)
then you should get '2026-1-15'.

Combining both suggested changes yields
_year(current_date)
|| '-' ||
_month(current_date)
|| '-' ||
_day(current_date)
which will also return '2026-1-15'.

Having said all that, I just noticed that the code I suggested will only return a single digit for month for any month before October and you requested MM. I have another, inelegant, solution for that. The code looks at the month value and concatenates a '0' if it is less than 10.
With date separators:
_year(current_date)
|| '-' ||
if (_month(current_date) < 10)
then ('0')
else ('')
||
_month(current_date)
|| '-' ||
_day(current_date)
returns 2026-01-15

Without date separators:
_year(current_date)
||
if (_month(current_date) < 10)
then (0)
else (null)
||
_month(current_date)
||
_day(current_date)
returns 20260115

To summarize
  • Both || and + can be used for concatenation. Using the + operator to concatenate can result in unexpected addition when all values are numeric.
  • Data formatting for csv/Excel Data can be a bit of a pain in my experience.

#4
Reporting / Re: Date format in CSV
Last post by Good Friend - 14 Jan 2026 03:18:45 PM
Thanks Johnson for your response. Tried your code and it isnt working as expected. I'm using current_Date as date and backend is SQL server and the result is coming as 2041.
#5
Reporting / Re: Date format in CSV
Last post by sjohnson - 14 Jan 2026 11:26:33 AM
When I had a similar problem, I used something like this to force the date into the correct format

_year(cast([Date], date))
+ '-' +
_month(cast([Date], date))
+ '-' +
_day(cast([Date], date))

Not the most elegant solution, but it worked.
#6
Reporting / Date format in CSV
Last post by Good Friend - 14 Jan 2026 11:04:29 AM
Date format in CSV is coming as MM/DD/YYYY. I'm trying for the format YYYY-MM-DD. Tried different ways and its not working for me. Any inputs or workaround will be appreciated. Thanks.
#7
COGNOS Planning / Re: Contributor - java.lang.ou...
Last post by rakeshjogi - 12 Jan 2026 02:31:34 AM
Usually, OutOfMemoryError occurs because of insufficient Java heap memory allocation, which indicates that your JVM is running out of memory to allocate for objects in the heap.  Even though you've allocated some GB to the container, there could be a possibility that the actual Java heap size being used by the JVM is much lower. This is because, always, JVM by default does not utilize the full container memory unless we instruct to.  In this case, the java.lang.OutOfMemoryError indicates that the application is still running out of Java heap memory despite increasing the size. Since you've already raised the heap from 88 MB to 128 MB and found that 256 MB causes errors, I think it's reasonable to experiment with intermediate values between them.

Heap size does not need to be a multiple of 16 or 64,  you can safely choose any reasonable number such as 160 MB, 192 MB, or 200MB and test the stability and performance. You can slowly increase the heap size and check until the issue no longer occurs. Meanwhile, keep an eye on the application's memory consumption.
Suppose if the  problem reappears, then your application may be experiencing memory leak or there could be inefficient memory usage in the application rather than just insufficient heap size.

Collecting heap dump  and analyzing using the tool HeapHero or EclipseMAT can help identify which objects are consuming the most memory.
#8
Reporting / Tree Prompts 12.1.1 upgrade
Last post by aricm - 07 Jan 2026 01:50:36 PM
Been searching Fix Pack(s) and such for an answer with no luck.  Anyone notice tree prompts with 12.1.1 (DMR source) no longer respect the "order" users select when output is excel/html and instead now sorts based on database sort?  Upgraded from 11.1.7 which outputs followed the sort order when using Ctrl-selections.  We also recently upgraded from Oracle to Sql.  Appreciate any expeirences with this.
#9
Reporting / Re: Need help with a predictab...
Last post by FerdH4 - 05 Jan 2026 03:26:44 PM
Thanks again dougp - I've got it covered now. I'm extrapolating from the XML you've already kindly shared.
#10
Reporting / Re: Need help with a predictab...
Last post by dougp - 02 Jan 2026 06:19:58 PM
sample input and desired output please