Cognos Analytics

Cognos Analytics

Connect, learn, and share with thousands of IBM Cognos Analytics users! 

 View Only
  • 1.  Adding a 'New line' in a piece of text

    Posted Tue January 14, 2020 03:18 AM
    Is it possible to create the effect of a new paragraph in an If/Then/Else text cacluation.

    For example I currently have 

    if ( fact_masterActivity.totalCallLength >= fact_activityTargets.at_callTimeTarget )
    then ('Text type one here. This should be a new paragraph in the report')
    else ('Text type two here)

    How do I get the true statement to display in the report like this

    "Text type one here.

    This should be a new paragraph in the report"

    Rather than this 
    "Text type one here. This should be a new paragraph in the report"

    ------------------------------
    Jonathan berry
    ------------------------------

    #CognosAnalyticswithWatson


  • 2.  RE: Adding a 'New line' in a piece of text

    Posted Tue January 14, 2020 05:23 AM
    I've never tried it in Cognos, but back in the dark ages I'd have done something like this by appending the ascii code for a line break - ASC(13) from memory, but please check first.

    ------------------------------
    Chris Turner
    ------------------------------



  • 3.  RE: Adding a 'New line' in a piece of text

    Posted Tue January 14, 2020 09:03 AM
      |   view attached

    @Jonathan berry I tested the below using Cognos Analytic 11.1.4 and DQM and it works ​.

    All you need to do is add a new line within the text area and it should display the same in the output.

    if ([Sales (query)].[Products].[Product line] = 'Camping Equipment') then
    ('Camping

    Equipment')
    else ('Golf
    Equipment')



    ------------------------------
    DENNY NAREZNY
    ------------------------------



  • 4.  RE: Adding a 'New line' in a piece of text

    Posted Tue January 14, 2020 09:23 AM
    Hi Denny,

    Thank you, this doesn't appear to work in 11.1.2

    Jon

    ------------------------------
    Jonathan berry
    ------------------------------



  • 5.  RE: Adding a 'New line' in a piece of text

    Posted Tue January 14, 2020 10:41 AM
    I tested in 11.1.2 and it works for me. Might be something specific to the design of the report. Could you attach a copy of your report spec?

    ------------------------------
    DENNY NAREZNY
    ------------------------------



  • 6.  RE: Adding a 'New line' in a piece of text

    Posted Tue January 14, 2020 11:25 AM
    Hi Denny,

    It works in a report, but I need this to work in a dashboard too.

    Jon

    ------------------------------
    Jonathan berry
    ------------------------------



  • 7.  RE: Adding a 'New line' in a piece of text

    Posted Thu January 30, 2025 02:43 AM

    Whilst there are many ways of introducing a Carriage Return / New Line into a report, it doesn't look like any of the dashboard text visualisations (List, Table, Crosstab) respect these characters. You could try raising a bug or an enhancement request. My guess is as they are deliberately stripping out special characters before displaying it will say working as intended. If you log an enhancement request then post the request here and ask for votes. Good luck!



    ------------------------------
    Marc Reed
    Reporting Lead
    ------------------------------



  • 8.  RE: Adding a 'New line' in a piece of text

    Posted Wed January 29, 2025 05:26 AM

    Can we do this in dynamic text i.e. display name coming from attribute of business unit dimension having Legal entity name also after '-' delimiter . Can we do this in Cognos in reports using Tm1 as a source. MDX report.

    Original Text :-  'Business Unit Name - Legal Entity name' 

     Expected output :-

    'Business Unit Name' 

    'Legal Entity name '



    ------------------------------
    sumeet yadav
    ------------------------------