COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: cielo on 26 Nov 2019 09:06:58 PM

Title: List no data text dispaly
Post by: cielo on 26 Nov 2019 09:06:58 PM
I have a list and the associated data items not having data.I would like to display "No data available" message ,have tried selecting no data content text since the data items having null value the message didn't get displayed. Could you please help with a solution
Title: Re: List no data text dispaly
Post by: oscarca on 27 Nov 2019 03:19:59 AM
Maybe you can create a case-statement ?
case
      when([Data item] = null)
      then('No data available')
      else([Data item]
end

and also, are you sure that Null is not '' i.e blank because if its an empty string the No data Available text property will not work.
You can try by:
case
      when([Data item] = '')
      then(null)
      else([Data item]
end

To convert empty string to null values and then apply the NO data Available text property.

Best regards,
Oscar

Title: Re: List no data text dispaly
Post by: Andrei I on 27 Nov 2019 08:40:27 AM
You can specify No Data Contents option.
I just checked: in the CA v.11.1 R4 it is enabled by default.
If your query for the list does not return any data then No Data Available should be displayed

You always can set a specific content
See attached
Title: Re: List no data text dispaly
Post by: cielo on 27 Nov 2019 10:15:20 AM
Thank you for the response. My list value appearing as null values though No data message is not visible. I have tried implementing Oscarca's suggestion.
Direct no data available option is also not working
Title: Re: List no data text dispaly
Post by: Andrei I on 27 Nov 2019 11:05:07 AM
Does your underlying query for the list return rows with null values?
E.g.  your list looks like this:

Row Number Column 1 Column 2 Column 3
1 Value 1 1 Value 1 2 NULL
2 Value 2 1NULL Value 2 3

And you want to replace NULL with "No data available" ?
Title: Re: List no data text dispaly
Post by: cielo on 27 Nov 2019 01:50:24 PM
Thank you again!

My data is like below:

Row Number   Column 1   Column 2   Column 3 column(which is not using in lis)
1   NULL      NULL      NULL      VALUE1
2   NULL      NULL   NULL                 Value2

I would like to completely replace the list with "No data available " message
Title: Re: List no data text dispaly
Post by: Andrei I on 27 Nov 2019 02:35:37 PM
try to add a detail filter:

not(
[Column 1] is null
and
[Column 2] is null

... add all visible columns in the list
)

Essentially this will output any rows ONLY if at least one visible column is not null.
Therefore if for all rows all visible columns are NULL then query will NOT return any rows. And default No Data processing should kick in...