Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld starts MONDAY! last chance to register is now ! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rains
Contributor III
Contributor III

Nulls coming as '-'

I am pulling data from SQL. I have a field with null value. The value is coming as '-' in qlik.

I did check using isnull and even used len(Trim(..

But still it is coming as '-'.

How can I proceed?

 

Thanks

 

 

Labels (1)
9 Replies
marcus_sommer
MVP & Luminary
MVP & Luminary

The '-' is just a visible replacement for NULL to visualize the exists of NOTHING.

- Marcus

rains
Contributor III
Contributor III
Author

Hi,

But then when I compare using isnull(A,10,2), the else gets the value, but the if clause does not. For any null I need to replace it with eg. 10.

 

Why is it not working. Am I missing something?

 

Thanks,

Tiago_Valls
Contributor II
Contributor II

Hello,

How are you?

I think that , you can use in your script this.

IF( ISNULL('PUTYOURFIELD'), 'eg. 10', 'PUTYOURFIELD') AS NAME

So, you will change '-' for the word fieldnull then you can do a filter or compare.

Bye

 

 

rains
Contributor III
Contributor III
Author

I did exactly the same,

IF( ISNULL('PUTYOURFIELD'), 'eg. 10', 'PUTYOURFIELD') AS NAME

But it is not working.

 

Tiago_Valls
Contributor II
Contributor II

Please, 

Can you post a part of script where is the code?

rains
Contributor III
Contributor III
Author

if( isnull (left(FieldName,1)), '10',  left(FieldName,1) )

 

Fieldname is being pulled from SQL. 

Tiago_Valls
Contributor II
Contributor II

Try it,

 

if (isnull(FieldName), '10', left ( FieldName , 1))

or

if (left (FieldName, 1)= ' ', '10', left ( FieldName , 1))

marcus_sommer
MVP & Luminary
MVP & Luminary

Those values might not be a real NULL and then isnull() won't work. Usually this is better fetched with:

if(len(trim(FIELD)), 'YourDefaultValue', FIELD)

If it's a numeric field you could also use: alt(FIELD, 'YourDefaultValue')

- Marcus

rains
Contributor III
Contributor III
Author

Still the same