Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

isnull/isempty?

Hi,

I want to check if a field is empty.

How do I do?

I want to use below case

case when (isempty(max(o.created_at)),'null',max(o.created_at)) as last_order_date,

If the field max(o.created_at) is empty, then I want to add the text "null" otherwise the date schould be shown.

/Julia

1 Solution

Accepted Solutions
SunilChauhan
Champion II
Champion II

use below code

if(isnull(max(o.created_at))=-1,'null',max(o.created_at)) ) as last_order_date,

Hope this helps

Sunil Chauhan

View solution in original post

4 Replies
hic
Former Employee
Former Employee

If( Len( Trim( Field ) ) = 0, ...

is usually the best test. See more on http://community.qlik.com/docs/DOC-3155

HIC

Gysbert_Wassenaar

Try: alt(max(o.created_at),'null') as last_order_date


talk is cheap, supply exceeds demand
SunilChauhan
Champion II
Champion II

use below code

if(isnull(max(o.created_at))=-1,'null',max(o.created_at)) ) as last_order_date,

Hope this helps

Sunil Chauhan
Not applicable
Author

Hi,

Thanks.

Then I get that the "isnull" function requires 2 arguments?

/Julia