COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Francus81 on 01 Oct 2018 12:16:11 PM

Title: Using ISNULL or IS EMPTY into a HTML Item
Post by: Francus81 on 01 Oct 2018 12:16:11 PM
Hi, I created a report which contains two parameters(pGrupoAgente and pAgente)

I created a HTML item(report expression type) that displays the chosen values for both parameters where pGrupoAgente is required and pAgente is optional:

ParamDisplayValue('pGrupoAgente') + "/" +  ParamDisplayValue('pAgente')

When both parameters are chosen, the HTML Item shows correctly both values; but when only "GrupoAgente" is chosen, the HMTL Item doesn't show anything.

I want to use some function such as ISNULL or ISEMPTY over ParamDisplayValue('pAgente') in order to show the value of pGrupoAgente when Agent is not chosen.

Any suggestions?

Regards



Title: Re: Using ISNULL or IS EMPTY into a HTML Item
Post by: cognostechie on 01 Oct 2018 12:24:19 PM
so you are asking a question and saying that you already know the answer ?
Title: Re: Using ISNULL or IS EMPTY into a HTML Item
Post by: Francus81 on 01 Oct 2018 12:35:18 PM
Hi cognostechie,

My question is if it's possible to apply a function similar to the SQL function ISNULL into a HTML item?

Regards
Title: Re: Using ISNULL or IS EMPTY into a HTML Item
Post by: cognostechie on 01 Oct 2018 01:22:51 PM
Create a Layout Calculation and insert something like this:

Case

  When ParamDisplayValue('pGrupoAgente') is null and ParamDisplayValue('pAgente') is not null
   Then ParamDisplayValue('pAgente')

  When ParamDisplayValue('pGrupoAgente') is not null and ParamDisplayValue('pAgente') is null
    Then ParamDisplayValue('pGrupoAgente')

  When ParamDisplayValue('pGrupoAgente') is null and ParamDisplayValue('pAgente') is null
    Then ''

  When ParamDisplayValue('pGrupoAgente') is not null and ParamDisplayValue('pAgente') is not null
     Then ParamDisplayValue('pGrupoAgente')  + '/' + ParamDisplayValue('pAgente')

Else ''

End
Title: Re: Using ISNULL or IS EMPTY into a HTML Item
Post by: Francus81 on 01 Oct 2018 02:47:05 PM
It perfectly works!

Thanks Cognostechie