Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to use isnull in expression

Hi,

how to use isnull in expression?

8 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

IsNull(expr )

Returns -1 (true) if expr returns NULL, otherwise 0 (false).

Use IsNull(FieldName) will return true if it is null

ashfaq_haseeb
Champion III
Champion III

What are you trying to achieve.

Can you post your application

You can use like this

If(RowNo() = 0 or IsNull(RowNo()),Sum(Sales)

regards

ASHFAQ

Not applicable
Author

In set analysis How to write isnull

eg.I want to use isnull for profitCent,But How to use in this expression.

num(sum({<PODate = {'>=$(=Date(MonthStart(min(CalenderDate)))) <=$(=Date(max(CalenderDate)))'} >} Amt))

amit_saini
Master III
Master III

Amol,

Below are few examples:

1. IF(ISNULL(ItemName)=0, ItemName, '001' ) AS ItemName

2.If( Len(Trim(Field))=0 or Isnull(Field) , this, that) as FieldName

3. =If( if(Year<>2013,avg([Act % of Rev.]),(Sum([Act. Scrap $])/sum([Act Revenue])))<>0,

     if(Year<>2013,avg([Act % of Rev.]),(Sum([Act. Scrap $])/sum([Act Revenue]))),

     null()

)

Thanks,

AS

ashfaq_haseeb
Champion III
Champion III

Hi

Considering profitCent is valid field.

Try like below

num(sum({<PODate = {'>=$(=Date(MonthStart(min(CalenderDate)))) <=$(=Date(max(CalenderDate)))'},profitCent={''}>} Amt))

Regards

ASHFAQ

Not applicable
Author

How to use isnull in given example

ashfaq_haseeb
Champion III
Champion III

No Attachment

regards

ASHFAQ

anbu1984
Master III
Master III

Try


num(sum({<PODate = {'>=$(=Date(MonthStart(min(CalenderDate)))) <=$(=Date(max(CalenderDate)))'},

Amt={'=Len(Trim(profitCent))=0'}>} Amt))

Or

num(sum({<PODate = {'>=$(=Date(MonthStart(min(CalenderDate)))) <=$(=Date(max(CalenderDate)))'},

Amt={'=NullCount(profitCent)>0'}>} Amt))