Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tvisha
Creator II
Creator II

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)
  • Nulls

9 Replies
marcus_sommer

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

- Marcus

tvisha
Creator II
Creator II
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

 

 

tvisha
Creator II
Creator II
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?

tvisha
Creator II
Creator II
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

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

tvisha
Creator II
Creator II
Author

Still the same